dify
dify copied to clipboard
fix(workflow): validate node compatibility when importing dsl between chatflows and workflows
[!IMPORTANT]
- Make sure you have read our contribution guidelines
- Ensure there is an associated issue and you have been assigned to it
- 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:
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
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) andcd web && npx lint-staged(frontend) to appease the lint gods
@crazywoola PTAL.