Skip to main content

Overview

The n8n_workflow_versions tool provides comprehensive version management for n8n workflows. It allows you to view version history, rollback to previous states, and manage version storage.
Requires N8N_API_URL and N8N_API_KEY to be configured.

Parameters

mode
string
required
Operation mode. One of: list, get, rollback, delete, prune, truncate
workflowId
string
Workflow ID (required for list, rollback, delete, prune modes)
versionId
number
Version ID (required for get mode and single version delete, optional for rollback)
limit
number
default:"10"
Maximum versions to return in list mode
validateBefore
boolean
default:"true"
Validate workflow structure before rollback
deleteAll
boolean
default:"false"
Delete all versions for workflow (delete mode only)
maxVersions
number
default:"10"
Keep N most recent versions (prune mode only)
confirmTruncate
boolean
default:"false"
REQUIRED: Must be true to truncate all versions (truncate mode only)

Modes

View version history for a workflow
# List last 10 versions
{
  "mode": "list",
  "workflowId": "workflow-123",
  "limit": 10
}

Response

mode
string
The operation mode that was executed
workflowId
string
Workflow ID (for list, get, rollback, delete, prune modes)
versions
array
Array of version objects (list mode)
version
object
Version details (get mode)
success
boolean
Whether the operation succeeded
message
string
Operation result message

Use Cases

Track all changes made to a workflow over time. View who made changes and when.
If a workflow update causes issues, quickly rollback to a previous working version.
Prune old versions to save storage space while keeping recent history.
Restore workflows to known-good states after configuration errors or bugs.

Best Practices

Before rolling back, validate the target version to ensure it will work with your current n8n setup.
Always keep at least a few recent versions as backups. Don’t prune too aggressively.
Version history is maintained automatically by n8n when workflows are updated.

Build docs developers (and LLMs) love