data/skills/n8n-mcp-tools-expert/VALIDATION_GUIDE.md
Complete guide for validating node configurations and workflows.
Validate early, validate often
Validation is typically iterative with validate → fix cycles
The validate_node tool provides all validation capabilities with different modes.
Speed: <50ms
Use when: Checking what fields are required
validate_node({
nodeType: "nodes-base.slack",
config: {}, // Empty to see all required fields
mode: "minimal"
})
Returns:
{
"valid": true, // Usually true (most nodes have no strict requirements)
"missingRequiredFields": []
}
When to use: Planning configuration, seeing basic requirements
Speed: <100ms
Use when: Validating actual configuration before deployment
validate_node({
nodeType: "nodes-base.slack",
config: {
resource: "channel",
operation: "create",
channel: "general"
},
profile: "runtime" // Recommended!
})
// mode="full" is the default
Choose based on your stage:
minimal - Only required fields
runtime - Values + types (RECOMMENDED)
ai-friendly - Reduce false positives
strict - Maximum validation
{
"nodeType": "nodes-base.slack",
"workflowNodeType": "n8n-nodes-base.slack",
"displayName": "Slack",
"valid": false,
"errors": [
{
"type": "missing_required",
"property": "name",
"message": "Channel name is required",
"fix": "Provide a channel name (lowercase, no spaces, 1-80 characters)"
}
],
"warnings": [
{
"type": "best_practice",
"property": "errorHandling",
"message": "Slack API can have rate limits",
"suggestion": "Add onError: 'continueRegularOutput' with retryOnFail"
}
],
"suggestions": [],
"summary": {
"hasErrors": true,
"errorCount": 1,
"warningCount": 1,
"suggestionCount": 0
}
}
missing_required - Must fixinvalid_value - Must fixtype_mismatch - Must fixbest_practice - Should fix (warning)suggestion - Optional improvementSpeed: 100-500ms
Use when: Checking complete workflow before execution
Syntax:
validate_workflow({
workflow: {
nodes: [...], // Array of nodes
connections: {...} // Connections object
},
options: {
validateNodes: true, // Default: true
validateConnections: true, // Default: true
validateExpressions: true, // Default: true
profile: "runtime" // For node validation
}
})
Validates:
Returns: Comprehensive validation report with errors, warnings, suggestions
// Validate workflow already in n8n
n8n_validate_workflow({
id: "workflow-id",
options: {
validateNodes: true,
validateConnections: true,
validateExpressions: true,
profile: "runtime"
}
})
Typical cycle: 23s thinking, 58s fixing
1. Configure node
↓
2. validate_node (23s thinking about errors)
↓
3. Fix errors
↓
4. validate_node again (58s fixing)
↓
5. Repeat until valid
Example:
// Iteration 1
let config = {
resource: "channel",
operation: "create"
};
const result1 = validate_node({
nodeType: "nodes-base.slack",
config,
profile: "runtime"
});
// → Error: Missing "name"
// Iteration 2 (~58s later)
config.name = "general";
const result2 = validate_node({
nodeType: "nodes-base.slack",
config,
profile: "runtime"
});
// → Valid!
When it runs: On ANY workflow update (create or update_partial)
What it fixes (automatically on ALL nodes):
singleValuesingleValue: trueconditions.options metadataconditions.options for all rulesWhat it CANNOT fix:
Example:
// Before auto-sanitization
{
"type": "boolean",
"operation": "equals",
"singleValue": true // Binary operators shouldn't have this
}
// After auto-sanitization (automatic!)
{
"type": "boolean",
"operation": "equals"
// singleValue removed automatically
}
Recovery tools:
cleanStaleConnections operation - removes broken connectionsn8n_autofix_workflow({id}) - preview/apply fixesUse when: Validation errors need automatic fixes
// Preview fixes (default - doesn't apply)
n8n_autofix_workflow({
id: "workflow-id",
applyFixes: false, // Preview mode
confidenceThreshold: "medium" // high, medium, low
})
// Apply fixes
n8n_autofix_workflow({
id: "workflow-id",
applyFixes: true
})
Fix Types:
expression-format - Fix missing = prefix in expressionstypeversion-correction - Downgrade unsupported typeVersionserror-output-config - Remove conflicting onError settingsnode-type-correction - Fix unknown node types via similarity matching (90%+ confidence)webhook-missing-path - Generate UUIDs for webhook nodes missing pathstypeversion-upgrade - Smart upgrade nodes to latest versions with auto-migrationversion-migration - Guidance for complex breaking changes (manual steps)Confidence Threshold: high (90%+), medium (70-89%, default), low (any)
Post-update guidance: Check postUpdateGuidance in the response for version upgrade migration steps.
Binary operators (compare two values):
singleValue: trueUnary operators (check single value):
singleValue: trueAuto-sanitization fixes these automatically!
1. Read error message carefully
2. Check if it's a known false positive
3. Fix real errors
4. Validate again
5. Iterate until clean
"Required field missing" → Add the field with appropriate value
"Invalid value" → Check allowed values in get_node output
"Type mismatch" → Convert to correct type (string/number/boolean)
"Cannot have singleValue" → Auto-sanitization will fix on next update
"Missing operator metadata" → Auto-sanitization will fix on next update
Some validation warnings may be acceptable:
Use ai-friendly profile to reduce false positives.
mode: "minimal" for quick checksn8n_autofix_workflow for bulk fixesactivateWorkflow operation)// Step 1: Get node requirements (quick check)
validate_node({
nodeType: "nodes-base.slack",
config: {},
mode: "minimal"
});
// → Know what's required
// Step 2: Configure node
const config = {
resource: "message",
operation: "post",
channel: "#general",
text: "Hello!"
};
// Step 3: Validate configuration (full validation)
const result = validate_node({
nodeType: "nodes-base.slack",
config,
profile: "runtime"
});
// Step 4: Check result
if (result.valid) {
console.log("Configuration valid!");
} else {
console.log("Errors:", result.errors);
// Fix and validate again
}
// Step 5: Validate in workflow context
validate_workflow({
workflow: {
nodes: [{...config as node...}],
connections: {...}
}
});
// Step 6: Apply auto-fixes if needed
n8n_autofix_workflow({
id: "workflow-id",
applyFixes: true
});
Key Points:
n8n_autofix_workflow for automatic fixesTool Selection:
Related: