Feature: Ability to Disable Nodes#6422
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a feature to disable nodes within a flow, preventing them and their downstream descendants from being executed or validated. The implementation includes UI updates to visualize disabled states, a toggle action in the node toolbar, and server-side logic to filter executable flow data and remove references to disabled nodes. Feedback highlights several areas for improvement in the server-side filtering logic, such as preserving array structures, broadening the reference-matching regex, and avoiding data corruption from unconditional string trimming. There are also notes regarding logic consistency in downstream re-enabling and code duplication across packages.
| if (Array.isArray(value)) { | ||
| return value | ||
| .map((item) => removeDisabledNodeReferences(item, disabledNodeIds)) | ||
| .filter((item) => item !== '' && item !== undefined && item !== null) |
There was a problem hiding this comment.
Filtering out empty strings from arrays after removing disabled node references can be problematic. If a node expects a fixed-length array or relies on specific indices, removing elements will shift the remaining items and likely cause logic errors. It is generally safer to preserve the array structure by keeping the empty values.
| .filter((item) => item !== '' && item !== undefined && item !== null) | |
| .filter((item) => item !== undefined && item !== null) |
References
- When handling potentially invalid data, prefer throwing an error or maintaining structure rather than silently returning a default or empty value to promote fail-fast behavior.
| @@ -0,0 +1,81 @@ | |||
| export const isNodeExplicitlyDisabled = (node) => { | |||
There was a problem hiding this comment.
This file is a duplicate of packages/agentflow/src/core/utils/disabledNodes.ts. Maintaining identical logic in two separate files across packages increases maintenance overhead and the risk of bugs. Consider centralizing this logic in a shared utility module.
References
- Maintain consistency across the repository by following established patterns and avoiding code duplication.
Summary
This PR introduces a “Disable Node” capability, allowing users to exclude nodes from execution without deleting nodes or rewiring the graph. (addresses #5625)
With Condition node disabled:
Flowise.-.Build.AI.Agents.Visually.-.DuckDuckGo.2026-05-22.15-27-30.mp4
With Condition node enabled:
Flowise.-.Build.AI.Agents.Visually.-.DuckDuckGo.2026-05-22.15-28-06.mov
Features
Changes