dify icon indicating copy to clipboard operation
dify copied to clipboard

fix(workflow): validate node compatibility when importing dsl between chatflows and workflows

Open yangzheli opened this issue 1 month ago • 1 comments

[!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 #24883

  • Use js-yaml to parse dsl content, and validate node compatibility when importing dsl between chatflows and workflows in the frontend. The valid nodes include: valid nodes

Screenshots

Before

  • import workflow with end node

https://github.com/user-attachments/assets/85fb041a-7694-4dca-acc9-6b090fbc7bb9

  • import workflow with trigger node, however these trigger features are only available for workflows
import trigger  abnormal

After

  • import workflow without end/trigger node

https://github.com/user-attachments/assets/c4a40729-9920-484a-9b87-afe0ec2d60f9

  • import workflow with end/trigger node

https://github.com/user-attachments/assets/298fe81f-e667-478d-abcd-6ec2afd96d6b

Checklist

  • [ ] This change requires a documentation update, included: Dify Document
  • [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

yangzheli avatar Nov 09 '25 03:11 yangzheli

@crazywoola PTAL.

yangzheli avatar Nov 13 '25 15:11 yangzheli