Overview
Update workflows incrementally using targeted diff operations instead of sending the entire workflow. This approach:- Reduces token usage by 80-90% compared to full workflow updates
- More precise edits with clearer intent
- Supports batching - apply unlimited operations in a single request
- Atomic or best-effort - choose transaction behavior
Endpoint
Request Parameters
Workflow ID to update
Array of diff operations to apply. Each operation must have a
type field.Supported Types:addNode,removeNode,updateNode,moveNodeenableNode,disableNodeaddConnection,removeConnection,rewireConnectionactivateWorkflow,deactivateWorkflowupdateSettings,updateNameaddTag,removeTagcleanStaleConnections
If
true, only validate operations without applying themIf
true, apply valid operations even if some fail (best-effort mode)Default (false) is atomic - all operations succeed or all fail.Create version backup before applying operations
Human-readable description of changesExample:
"Add Slack notification for errors"Operation Types
Node Operations
addNode
Add a new node to the workflow."addNode"Complete node object (see Create Workflow for structure)
Human-readable description
removeNode
Remove a node from the workflow."removeNode"Name of the node to remove
updateNode
Update node parameters using dot notation paths."updateNode"Name of the node to update
Object with dot-notation paths as keys and new values
moveNode
Move a node to a new position on the canvas."moveNode"Name of the node to move
New
[x, y] positionenableNode / disableNode
Enable or disable a node."enableNode" or "disableNode"Name of the node
Connection Operations
addConnection
Connect two nodes."addConnection"Source node name
Target node name
Source output type
Target input type
Source output index
Target input index
Smart parameter for IF nodes:
"true" or "false"Automatically sets sourceIndex based on branch.Smart parameter for Switch nodes: Case number (0-based)Automatically sets
sourceIndex for the specified case.removeConnection
Remove a connection between nodes."removeConnection"Source node name
Target node name
Source output type
Source output index
rewireConnection
Change the target of an existing connection."rewireConnection"Source node name
Current target node name
New target node name
cleanStaleConnections
Remove connections to non-existent nodes."cleanStaleConnections"If
true, only report stale connections without removing themWorkflow Operations
activateWorkflow / deactivateWorkflow
Activate or deactivate the workflow."activateWorkflow" or "deactivateWorkflow"updateSettings
Update workflow settings."updateSettings"Settings object (see Create Workflow for properties)
updateName
Update workflow name."updateName"New workflow name
addTag / removeTag
Add or remove workflow tags."addTag" or "removeTag"Tag name
Response
Operation success status
Update result
Success message with operation count
Detailed operation results
Complete Examples
See the comprehensive Workflow Diff Examples guide for:- All operation types with examples
- Common patterns (add processing step, replace node, error handling)
- Large batch operations (26+ operations in one request)
- Best practices and troubleshooting
Basic Examples
Simple operations for common tasks
Advanced Patterns
Multi-step refactoring and complex changes
Batch Processing
Build entire pipelines in one request
Error Handling
Validation and error recovery
Error Codes
Causes:
- Invalid operation structure
- Referenced node doesn’t exist
- Duplicate node names
- Invalid connection references
- Workflow structure violations after applying operations
- Use
validateOnly: trueto test operations - Check operation syntax in diff examples
- Ensure referenced nodes exist before connecting
Causes:
- Node type doesn’t exist
- Invalid parameter values
- Connection loop detected
- Missing required fields
- Use
validate_nodeto verify node configs - Check
details.errorsfor specific operation failures - In
continueOnErrormode, checkappliedvsfailedarrays
Causes:
- Binary operator with
singleValue: true - Unary operator missing
singleValue: true - Missing metadata on filter nodes (IF v2.2+, Switch v3.2+)
- Branch count mismatch on Switch nodes
- Stale connections after node removal
- Use
cleanStaleConnectionsoperation to remove orphaned connections - Check error details for specific structural issues
- Auto-sanitization runs automatically but can’t fix all issues
Transaction Behavior
Atomic Mode (default)
- All operations succeed or all fail
- Workflow remains unchanged if any operation fails
- Best for critical changes
Best-Effort Mode
- Applies valid operations even if some fail
- Response includes
appliedandfailedoperation indices - Useful for large batch operations where partial success is acceptable
Two-Pass Processing
The diff engine uses two-pass processing for optimal operation ordering: Pass 1: Node operations (addNode, removeNode, updateNode, moveNode, enable/disableNode)
Pass 2: All other operations (connections, settings, metadata)
This allows you to add nodes and connect them in the same request without worrying about operation order.
Best Practices
Performance
Token Savings
80-90% reduction vs full update
Batch Limit
Unlimited operations per request
Processing
Two-pass automatic ordering
Related Endpoints
- Update Full Workflow - Replace entire workflow
- Get Workflow - Fetch current workflow
- Validate Workflow - Validate before updating
- Workflow Versions - Version history and rollback