Skip to main content

Overview

Automatically detect and fix common workflow configuration errors. Preview fixes before applying them or apply immediately for rapid error resolution.
Auto-fix can resolve 80-90% of common validation errors including expression format issues, typeVersion mismatches, missing metadata, and more.

Endpoint

POST /workflows/:id/autofix

Request Parameters

id
string
required
Workflow ID to analyze and fixExample: "wf_abc123"
applyFixes
boolean
default:false
Whether to apply fixes to the workflow
  • false (default) - Preview mode: shows available fixes without applying
  • true - Apply mode: applies fixes and updates workflow
fixTypes
array
Specific fix types to apply (omit for all fixes)Available Types:
  • expression-format - Fix n8n expression syntax (missing = prefix)
  • typeversion-correction - Correct invalid typeVersion values
  • error-output-config - Fix error output configurations
  • node-type-correction - Correct malformed node type names
  • webhook-missing-path - Add missing webhook paths
  • typeversion-upgrade - Upgrade nodes to latest supported versions
  • version-migration - Provide migration guidance for breaking changes
Example: ["expression-format", "typeversion-correction"]
confidenceThreshold
string
default:"medium"
Minimum confidence level for applying fixesLevels:
  • low - Apply all fixes (including experimental)
  • medium - Apply medium and high confidence fixes (recommended)
  • high - Only apply high confidence fixes (safest)
maxFixes
number
default:50
Maximum number of fixes to apply (1-100)Prevents excessive changes in a single operation.

Response

success
boolean
Operation success status
data
object
Auto-fix results

Fix Types

Expression Format Fixes

expression-format

Fixes:
  • Missing = prefix on expressions (e.g., {{ $json }}={{ $json }})
  • Extra whitespace around expressions
  • Malformed expression delimiters
Confidence: HighExample:
{
  "node": "Set Variable",
  "field": "values.value",
  "type": "expression-format",
  "before": "{{ $json.email }}",
  "after": "={{ $json.email }}",
  "confidence": "high"
}

Type Version Fixes

typeversion-correction

Fixes:
  • Invalid typeVersion values (e.g., "1"1)
  • Missing typeVersion (sets to 1)
  • TypeVersion higher than supported (downgrades)
Confidence: HighExample:
{
  "node": "HTTP Request",
  "field": "typeVersion",
  "type": "typeversion-correction",
  "before": "3",
  "after": 3,
  "confidence": "high"
}

typeversion-upgrade

Fixes:
  • Upgrades nodes to latest supported typeVersion
  • Applies smart migrations (preserves parameters)
  • Handles breaking changes gracefully
Confidence: MediumExample:
{
  "node": "IF Node",
  "field": "typeVersion",
  "type": "typeversion-upgrade",
  "before": 1,
  "after": 2,
  "confidence": "medium",
  "description": "Upgraded IF node from v1 to v2 with filter structure"
}

Node Type Fixes

node-type-correction

Fixes:
  • SHORT form to FULL form (e.g., nodes-base.webhookn8n-nodes-base.webhook)
  • Missing package prefixes
  • Incorrect package names
Confidence: HighExample:
{
  "node": "Webhook",
  "field": "type",
  "type": "node-type-correction",
  "before": "nodes-base.webhook",
  "after": "n8n-nodes-base.webhook",
  "confidence": "high"
}

Webhook Fixes

webhook-missing-path

Fixes:
  • Adds custom webhook paths when missing
  • Generates human-readable paths from workflow name
  • Ensures path uniqueness
Confidence: MediumExample:
{
  "node": "Webhook Trigger",
  "field": "parameters.path",
  "type": "webhook-missing-path",
  "before": null,
  "after": "customer-onboarding",
  "confidence": "medium"
}

Configuration Fixes

error-output-config

Fixes:
  • Missing error output configurations
  • Incorrect continueOnFail settings
  • Error handling metadata
Confidence: High

Migration Guidance

version-migration

Provides:
  • Migration guidance for breaking changes
  • Parameter mapping documentation
  • Manual steps required
Confidence: N/A (informational only)

Examples

curl -X POST "https://n8n.example.com/api/v1/workflows/wf_abc123/autofix" \
  -H "X-N8N-API-KEY: your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "applyFixes": false
  }'

Response Examples

{
  "success": true,
  "data": {
    "workflowId": "wf_abc123",
    "workflowName": "Customer Onboarding",
    "preview": true,
    "fixesAvailable": 7,
    "fixes": [
      {
        "node": "Set Variable",
        "field": "values.value",
        "type": "expression-format",
        "before": "{{ $json.email }}",
        "after": "={{ $json.email }}",
        "confidence": "high",
        "description": "Add missing = prefix to expression"
      },
      {
        "node": "HTTP Request",
        "field": "typeVersion",
        "type": "typeversion-correction",
        "before": "4",
        "after": 4,
        "confidence": "high",
        "description": "Convert typeVersion from string to number"
      },
      {
        "node": "IF Node",
        "field": "parameters.conditions.value1",
        "type": "expression-format",
        "before": "{{ $json.active }}",
        "after": "={{ $json.active }}",
        "confidence": "high",
        "description": "Add missing = prefix to expression"
      },
      {
        "node": "Webhook",
        "field": "parameters.path",
        "type": "webhook-missing-path",
        "before": null,
        "after": "customer-onboarding",
        "confidence": "medium",
        "description": "Add custom webhook path"
      }
    ],
    "summary": "7 fixes available (5 high confidence, 2 medium confidence)",
    "stats": {
      "expression-format": 3,
      "typeversion-correction": 3,
      "webhook-missing-path": 1
    },
    "message": "7 fixes available. Set applyFixes=true to apply them."
  }
}

Auto-Fix Workflow

1

Validate Workflow

First, validate to identify issues
n8n_validate_workflow({id: "wf_abc123"})
2

Preview Fixes

Check what auto-fix can resolve
n8n_autofix_workflow({
  id: "wf_abc123",
  applyFixes: false
})
3

Review Fixes

Examine the fixes array to understand changes
  • Check confidence levels
  • Review before and after values
  • Assess impact on workflow logic
4

Apply Fixes

Apply fixes with appropriate confidence threshold
n8n_autofix_workflow({
  id: "wf_abc123",
  applyFixes: true,
  confidenceThreshold: "medium"
})
5

Re-Validate

Confirm all issues are resolved
n8n_validate_workflow({id: "wf_abc123"})

Confidence Levels

High Confidence

Safe to Apply:
  • Expression format fixes
  • Type corrections
  • Node type format
  • Missing required fields
Risk: Very Low

Medium Confidence

Review Recommended:
  • Webhook path generation
  • Version upgrades (non-breaking)
  • Error handling config
  • Optional parameters
Risk: Low to Medium

Low Confidence

Requires Review:
  • Complex migrations
  • Breaking version changes
  • Ambiguous configurations
  • Experimental fixes
Risk: Medium to High

Limitations

Auto-Fix Cannot Resolve:
  • Logic errors (incorrect workflow design)
  • Invalid credentials
  • Missing external dependencies (APIs, databases)
  • Complex structural issues (circular dependencies)
  • Broken connections to deleted nodes (use cleanStaleConnections operation)
  • Custom node issues
  • Branch count mismatches (manual fix required)
For these issues, manual intervention or the n8n_update_partial_workflow tool is required.

Best Practices

Safe Auto-Fix Usage:
  1. Always preview first - Use applyFixes: false to review changes
  2. Start conservative - Use confidenceThreshold: "high" initially
  3. Apply incrementally - Fix high confidence issues first, then medium
  4. Validate after - Always run n8n_validate_workflow after auto-fix
  5. Test thoroughly - Test workflow execution after applying fixes
  6. Version backups - Auto-fix creates backups automatically, but verify
Avoid These Mistakes:
  • Blindly applying all fixes without review
  • Skipping post-fix validation
  • Not testing workflow after fixes
  • Applying fixes to production workflows without testing
  • Ignoring low confidence fixes that may need manual attention

Use Cases

Fix issues after deploying n8n.io templates:
// 1. Deploy template
const deployed = await n8n_deploy_template({
  templateId: 1234,
  autoFix: false // Deploy first
})

// 2. Auto-fix expression formats
await n8n_autofix_workflow({
  id: deployed.data.id,
  applyFixes: true,
  fixTypes: ["expression-format", "typeversion-correction"]
})

// 3. Validate
await n8n_validate_workflow({id: deployed.data.id})

Error Handling

NO_FIXES_AVAILABLE
string
Cause: Workflow has no auto-fixable issuesResolution: Check validation errors for manual fixes needed
WORKFLOW_NOT_FOUND
string
Cause: Invalid workflow IDResolution: Verify ID with n8n_list_workflows
FIX_APPLICATION_FAILED
string
Cause: Fixes could not be applied (workflow became invalid)Resolution: Review fixes and apply manually with n8n_update_partial_workflow
VALIDATION_AFTER_FIX_FAILED
string
Cause: Workflow still invalid after applying fixesResolution: Use automatic rollback (version restored) and fix issues manually

Performance

Auto-Fix Performance:
  • Preview mode: ~500ms for typical workflow
  • Apply mode: ~2-3 seconds (includes validation + backup + update)
  • Large workflows (50+ nodes): May take up to 5 seconds
  • Version upgrades: Additional 1-2 seconds per node upgraded
Conceived by Romuald Członkowski - www.aiadvisors.pl/en

Build docs developers (and LLMs) love