Skip to content

Conversation

@yangzheli
Copy link
Contributor

@yangzheli yangzheli commented Nov 9, 2025

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

Screenshots

Before

2025-11-09.11.20.42.mov

After

  • import workflow without end node
2025-11-09.11.17.48.mov
  • import workflow with end node
2025-11-09.11.18.36.mov

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

@yangzheli yangzheli marked this pull request as ready for review November 9, 2025 03:27
@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Nov 9, 2025
@yangzheli yangzheli closed this Nov 9, 2025
@yangzheli yangzheli reopened this Nov 9, 2025
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces frontend validation to prevent importing incompatible DSL files between chatflows and workflows, which is a great improvement for user experience. The implementation correctly uses js-yaml to parse the DSL and checks for invalid node types based on the application mode. The logic is sound and directly addresses the issue. I have one suggestion to refactor the new validation function for better readability and maintainability.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Import chatflow to workflow

1 participant