Add strict reference validation before deleting workflows
- Dominant language
- TypeScript
- Stars
- 156k
- Forks
- 24.6k
- Avg merge
- 22h 9m
- Merged PRs (30d)
- 610
Description
### Self Checks
- [x] I have read the [Contributing Guide](https://github.com/langgenius/dify/blob/main/CONTRIBUTING.md) and [Language Policy](https://github.com/langgenius/dify/issues/1542).
- [x] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones.
- [x] I confirm that I am using English to submit this report, otherwise it will be closed.
- [x] Please do not modify this template :) and fill in all the required fields.
### 1. Is this request related to a challenge you're experiencing? Tell me about your story.
Currently, when deleting a workflow, we do not have full visibility into how many workflows reference the workflow being deleted. the UI already shows a confirmation dialog and requires the user to enter the workflow name before deletion is allowed, but that is still not enough.
Deleting a workflow can severely impact other workflows that reference it. If a foundational workflow is referenced by many other workflows, recovery can be extremely painful.
Therefore, when deleting a workflow, the system should at minimum verify that no **published** workflow still references it. **If any published workflow does reference it, deletion should be blocked.**
### 2. Additional context or comments
_No response_
### 3. Can you help us with this feature?
- [ ] I am interested in contributing to this feature.
Contributor guide
Research direction
Start by tracing the workflow deletion entry point and the existing confirmation flow; the issue names no file or test. Check how published workflows reference the workflow being deleted, and verify that deletion is blocked when any such reference exists while remaining possible when none do.
Written by the indexing model from the issue text.
Assessment
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100