Skip to main content

Overview

n8n-MCP provides multi-level validation with different modes and profiles to balance accuracy, performance, and usability. This guide helps you choose the right validation strategy for your workflow.

Validation Levels

1

Level 1: Quick Check (Before Building)

Use mode: 'minimal' for fast required field validation:
validate_node({
  nodeType: 'n8n-nodes-base.slack',
  config: {
    resource: 'message',
    operation: 'post'
  },
  mode: 'minimal'
})
Performance: <100msChecks:
  • Required fields only
  • Visible properties based on current config
  • Basic type checking
Use when:
  • Rapid prototyping
  • Initial configuration
  • Quick sanity checks
2

Level 2: Comprehensive (Before Building)

Use mode: 'full' with validation profiles:
validate_node({
  nodeType: 'n8n-nodes-base.slack',
  config: {
    resource: 'message',
    operation: 'post',
    select: 'channel',
    channelId: 'C123456',
    text: 'Hello World'
  },
  mode: 'full',
  profile: 'runtime'
})
Checks:
  • All required and conditional fields
  • Type validation
  • Value constraints
  • Operation-specific rules
  • fixedCollection structures
  • Special type structures (filter, resourceMapper)
Returns:
  • Detailed errors
  • Auto-fix suggestions
  • Warnings and best practices
3

Level 3: Complete (After Building)

Validate the entire workflow:
validate_workflow(workflow)
Checks:
  • All node configurations
  • Connection validity
  • Expression syntax
  • Circular dependencies
  • AI Agent tool compatibility
4

Level 4: Post-Deployment

Validate deployed workflows:
// 1. Validate in n8n
n8n_validate_workflow({ id: 'workflow-id' })

// 2. Auto-fix common errors
n8n_autofix_workflow({ id: 'workflow-id' })

// 3. Monitor execution status
n8n_executions({ action: 'list' })

Validation Modes

Minimal Mode

Fast validation checking only required fields.
validate_node({
  nodeType: 'n8n-nodes-base.httpRequest',
  config: {
    url: 'https://api.example.com',
    method: 'GET'
  },
  mode: 'minimal'
})
What’s Checked:
  • ✅ Required properties
  • ✅ Property visibility
  • ❌ Type validation
  • ❌ Value constraints
  • ❌ Warnings
Performance: ~50-100msUse Cases:
  • Quick prototyping
  • Initial node setup
  • Batch validation
  • When speed matters most

Validation Profiles

Profiles control the strictness and noise level of validation:
{
  "mode": "full",
  "profile": "minimal"
}
What’s Reported:
  • ✅ Missing required fields only
  • ✅ Critical security warnings
  • ✅ Deprecated properties
  • ❌ Type mismatches
  • ❌ Best practices
  • ❌ Suggestions
Use When:
  • You need instant feedback
  • Batch validation of many nodes
  • Quick sanity checks
  • Performance is critical
Example Output:
{
  "valid": false,
  "errors": [
    {
      "type": "missing_required",
      "property": "channelId",
      "message": "Required property 'channelId' is missing"
    }
  ],
  "warnings": [],
  "suggestions": []
}
{
  "mode": "full",
  "profile": "ai-friendly"
}
What’s Reported:
  • ✅ All errors
  • ✅ Security warnings
  • ✅ Deprecated properties
  • ✅ Missing common properties
  • ✅ Best practices
  • ❌ Property visibility noise
  • ❌ Internal property warnings
Use When:
  • AI-assisted workflow building
  • Learning proper configuration
  • You want helpful suggestions
  • Default choice for most cases
Example Output:
{
  "valid": false,
  "errors": [/* all errors */],
  "warnings": [
    {
      "type": "missing_common",
      "property": "timeout",
      "message": "Consider setting a timeout for HTTP requests",
      "suggestion": "Add timeout: 10000 for 10 second timeout"
    }
  ],
  "suggestions": [
    "Add error handling with onError: 'continueRegularOutput'",
    "Consider adding retry logic with retryOnFail: true"
  ]
}
{
  "mode": "full",
  "profile": "strict"
}
What’s Reported:
  • ✅ All errors
  • ✅ All warnings
  • ✅ All suggestions
  • ✅ Best practices
  • ✅ Credential warnings
  • ✅ Error handling requirements
Use When:
  • Auditing workflows
  • Learning n8n best practices
  • Maximum security and reliability needed
  • Code review processes
Example Output:
{
  "valid": true,
  "errors": [],
  "warnings": [
    {
      "type": "security",
      "property": "nodeCredentialType",
      "message": "Hardcoded nodeCredentialType detected"
    },
    {
      "type": "best_practice",
      "property": "errorHandling",
      "message": "External service nodes should have error handling"
    }
  ],
  "suggestions": [
    "Consider adding error handling",
    "Add authentication if connecting to external services",
    "Set timeout configuration"
  ]
}

Choosing the Right Strategy

Rapid Prototyping

mode: 'minimal'
Fast feedback on required fields only

Production Workflows

mode: 'full'
profile: 'runtime'
Critical errors before deployment

Learning & Development

mode: 'full'
profile: 'ai-friendly'
Helpful suggestions and best practices

Security Audit

mode: 'full'
profile: 'strict'
Maximum scrutiny and compliance

Validation Patterns

Pattern 1: Two-Pass Validation

// Pass 1: Quick check while building
validate_node({
  nodeType: 'n8n-nodes-base.slack',
  config: { resource: 'message', operation: 'post' },
  mode: 'minimal'
})

// Pass 2: Full validation before deployment
validate_node({
  nodeType: 'n8n-nodes-base.slack',
  config: { /* complete config */ },
  mode: 'full',
  profile: 'runtime'
})

Pattern 2: Progressive Validation

// Step 1: Minimal (< 100ms)
validate_node({ mode: 'minimal' })

// Step 2: Operation-aware (~ 200ms)
validate_node({ mode: 'operation' })

// Step 3: Full workflow (~ 500ms)
validate_workflow(workflow)

Pattern 3: Batch + Detailed

// Batch validate all nodes quickly
for (node of nodes) {
  validate_node({ config: node.parameters, mode: 'minimal' })
}

// Full validation only for errors
if (hasErrors) {
  validate_node({ mode: 'full', profile: 'runtime' })
}

Special Type Validation

fixedCollection Structures

Nodes like If, Switch, and Filter use fixedCollection properties that require specific structures:
Bad Example
// ❌ FAILS: Object instead of array
{
  "conditions": {
    "string": { "value1": "test" }
  }
}
Good Example
// ✅ WORKS: Proper fixedCollection structure
{
  "conditions": {
    "string": [
      {
        "value1": "={{$json.field}}",
        "operation": "equals",
        "value2": "test"
      }
    ]
  }
}
Validation automatically detects and suggests fixes for these structures.

Complex Type Structures

Validation checks special types:
  • filter: Combinator + conditions array
  • resourceMapper: Mapping mode + value mappings
  • assignmentCollection: Assignments array
  • resourceLocator: Mode + value
Filter Example
{
  "combinator": "and",
  "conditions": [
    {
      "operator": {
        "type": "string",
        "operation": "equals"
      },
      "leftValue": "={{$json.status}}",
      "rightValue": "active"
    }
  ]
}

Auto-Fix Suggestions

Full validation mode provides auto-fix suggestions:
{
  "valid": false,
  "errors": [/* errors */],
  "autofix": {
    "url": "https://api.example.com",
    "conditions": {
      "string": [
        {
          "value1": "={{$json.field}}",
          "operation": "equals",
          "value2": "test"
        }
      ]
    }
  }
}
Apply auto-fixes:
const result = validate_node({ mode: 'full', profile: 'runtime' })
if (!result.valid && result.autofix) {
  config = { ...config, ...result.autofix }
}

Performance Comparison

ModeProfileTimeUse Case
minimal-~50msQuick checks
operationai-friendly~150msStep-by-step
fullminimal~200msFast comprehensive
fullruntime~300msProduction
fullai-friendly~350msDevelopment
fullstrict~500msAuditing

Best Practices

Start Minimal

Use minimal mode while building for instant feedback

Validate Fully Before Deploy

Always use full + runtime before production deployment

Use Operation Mode

Reduce noise by validating only relevant properties

Apply Auto-Fixes

Leverage auto-fix suggestions for common issues

Profile for Context

Choose profile based on your current goal

Validate Workflows

Don’t forget complete workflow validation

Next Steps

Building Workflows

Learn the complete workflow building process

AI Agent Workflows

Special validation for AI Agent workflows

Batch Operations

Efficient workflow updates

Troubleshooting

Common validation issues

Build docs developers (and LLMs) love