Workflow Version Control
Each change to a workflow can generate a version, creating a complete modification history with the ability to compare and restore previous versions.
How It Works
Section titled “How It Works”- When saving a workflow, a version can be created manually
- Before a rollback, the system automatically creates a backup version
- Each version stores the complete workflow_json (nodes, connections, configuration)
Operations
Section titled “Operations”Create Manual Version
Section titled “Create Manual Version”POST /api/versions/workflow/:workflowIdBody: { "description": "Added stock validation node" }The following is saved:
- Version number (sequential)
- Complete workflow JSON
- Change description
- Who created it
- Number of nodes and connections
View Version History
Section titled “View Version History”GET /api/versions/workflow/:workflowIdReturns the list of versions ordered from most recent to oldest:
[ { "id": 45, "version_number": 5, "name": "My Workflow", "description": "Added validation node", "is_auto": false, "nodes_count": 8, "edges_count": 9, "created_at": "2026-03-23T10:30:00Z" }, { "id": 42, "version_number": 4, "description": "Auto-backup before rollback", "is_auto": true, ... }]Restore Previous Version (Rollback)
Section titled “Restore Previous Version (Rollback)”POST /api/versions/workflow/:workflowId/rollback/:versionId- Restores the workflow_json from the selected version
- Automatically creates a backup of the current version before restoring
- Updates the workflow’s modification date
Compare Versions (Diff)
Section titled “Compare Versions (Diff)”GET /api/versions/workflow/:workflowId/diff/:version1Id/:version2IdReturns the differences between two versions:
{ "added_nodes": [ { "id": "node_8", "type": "decision", "label": "Validate stock" } ], "removed_nodes": [], "modified_nodes": [ { "id": "node_3", "changes": ["position", "config"] } ], "added_edges": [ { "source": "node_7", "target": "node_8" } ], "removed_edges": [], "summary": { "total_changes": 3, "nodes_added": 1, "nodes_removed": 0, "nodes_modified": 1, "edges_added": 1, "edges_removed": 0 }}Delete Version
Section titled “Delete Version”DELETE /api/versions/:versionIdCannot be deleted if it is the only existing version.
Automatic vs Manual Versions
Section titled “Automatic vs Manual Versions”| Type | When Created | is_auto Field |
|---|---|---|
| Manual | The user explicitly saves a version | false |
| Automatic | Before a rollback (safety backup) | true |