[PR #24939] Export DSL from history #30854

Closed
opened 2026-02-21 20:48:21 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/langgenius/dify/pull/24939

State: closed
Merged: Yes


Important

  1. Make sure you have read our contribution guidelines
  2. Ensure there is an associated issue and you have been assigned to it
  3. Use the correct syntax to link this PR: Fixes #<issue number>.

Summary

fix #24885

This pull request adds support for exporting an app's DSL configuration for a specific workflow version, both in the backend API and in the frontend UI. The changes enable users to export the configuration of any workflow version from the version history panel, improving flexibility and traceability for workflow management.

Backend API and service changes:

  • Added an optional workflow_id parameter to the app export API endpoint (api/controllers/console/app/app.py). This allows exporting the DSL for a specific workflow version if provided.
  • Updated the AppDslService.export_dsl method and related workflow service logic to accept and handle the workflow_id parameter, fetching the correct workflow configuration based on the ID [1] [2] [3] [4].
  • Enhanced tests to cover exporting DSL with a specific workflow ID and error handling for invalid workflow IDs (test_app_dsl_service.py).

Frontend UI changes:

  • Updated the DSL export hook and API client to support passing a workflow ID, enabling export of specific workflow versions (use-workflow-interactions.ts, service/apps.ts) [1] [2] [3].
  • Added an "Export DSL" option to the workflow version history context menu and implemented the corresponding UI logic to trigger DSL export for the selected version (use-context-menu.ts, version-history-panel/index.tsx, types.ts) [1] [2] [3] [4] [5].

Screenshots

Before After
... image

Checklist

  • This change requires a documentation update, included: Dify Document
  • I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!)
  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • I've updated the documentation accordingly.
  • I ran dev/reformat(backend) and cd web && npx lint-staged(frontend) to appease the lint gods
**Original Pull Request:** https://github.com/langgenius/dify/pull/24939 **State:** closed **Merged:** Yes --- > [!IMPORTANT] > > 1. Make sure you have read our [contribution guidelines](https://github.com/langgenius/dify/blob/main/CONTRIBUTING.md) > 1. Ensure there is an associated issue and you have been assigned to it > 1. Use the correct syntax to link this PR: `Fixes #<issue number>`. ## Summary fix #24885 This pull request adds support for exporting an app's DSL configuration for a specific workflow version, both in the backend API and in the frontend UI. The changes enable users to export the configuration of any workflow version from the version history panel, improving flexibility and traceability for workflow management. Backend API and service changes: * Added an optional `workflow_id` parameter to the app export API endpoint (`api/controllers/console/app/app.py`). This allows exporting the DSL for a specific workflow version if provided. * Updated the `AppDslService.export_dsl` method and related workflow service logic to accept and handle the `workflow_id` parameter, fetching the correct workflow configuration based on the ID [[1]](diffhunk://#diff-9645e0bcc755a4af22c7f48cc693bf3a5a54d15cc8606757988bdf477fedae02L535-R535) [[2]](diffhunk://#diff-9645e0bcc755a4af22c7f48cc693bf3a5a54d15cc8606757988bdf477fedae02L559-R576) [[3]](diffhunk://#diff-c1c416202ad3326ea935ead513b607aa8ef7f6b155b8d7b404edf9d0077cd0d2L100-R105) [[4]](diffhunk://#diff-c1c416202ad3326ea935ead513b607aa8ef7f6b155b8d7b404edf9d0077cd0d2L119-R123). * Enhanced tests to cover exporting DSL with a specific workflow ID and error handling for invalid workflow IDs (`test_app_dsl_service.py`). Frontend UI changes: * Updated the DSL export hook and API client to support passing a workflow ID, enabling export of specific workflow versions (`use-workflow-interactions.ts`, `service/apps.ts`) [[1]](diffhunk://#diff-76be873baec863ca29c14c66a0962ce44f240ecf8c4b790e6b274bc958a76402L349-R349) [[2]](diffhunk://#diff-76be873baec863ca29c14c66a0962ce44f240ecf8c4b790e6b274bc958a76402R361) [[3]](diffhunk://#diff-e35df56606fff9b8f10bc0cba1a7c4e965355d50e9944bd90d22e6da8cece2a2L38-R44). * Added an "Export DSL" option to the workflow version history context menu and implemented the corresponding UI logic to trigger DSL export for the selected version (`use-context-menu.ts`, `version-history-panel/index.tsx`, `types.ts`) [[1]](diffhunk://#diff-e8282e3da98d65b18b3a09f476d461960ecce8dad3a1b8d7aa33db387c1d740cR32-R35) [[2]](diffhunk://#diff-3689656f2361b5dd1d523fa556d9de2391ee5e193e1c7a5cc86e811d6e0e82bfL6-R6) [[3]](diffhunk://#diff-3689656f2361b5dd1d523fa556d9de2391ee5e193e1c7a5cc86e811d6e0e82bfR36) [[4]](diffhunk://#diff-3689656f2361b5dd1d523fa556d9de2391ee5e193e1c7a5cc86e811d6e0e82bfR111-R115) [[5]](diffhunk://#diff-1d99cdfce0b7202117388f1d8e25c9382e2e072bc5ba3c7922942cb561d5278eR451). ## Screenshots | Before | After | |--------|-------| | ... | <img width="331" height="363" alt="image" src="https://github.com/user-attachments/assets/8b199a5f-b8fe-45d8-9b11-da81e6db3f7c" />| ## Checklist - [ ] This change requires a documentation update, included: [Dify Document](https://github.com/langgenius/dify-docs) - [x] I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!) - [x] I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change. - [x] I've updated the documentation accordingly. - [x] I ran `dev/reformat`(backend) and `cd web && npx lint-staged`(frontend) to appease the lint gods
yindo added the pull-request label 2026-02-21 20:48:21 -05:00
yindo closed this issue 2026-02-21 20:48:21 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#30854