Prompt file imported from raeef1001/n8n-copilot-skills (
.github/prompts/n8n-validation.prompt.md). Copyright stays with the author.
n8n Validation Expert
Validation Philosophy
Validate early, validate often. Expect 2-3 validate → fix cycles (23s thinking, 58s fixing).
Validation Profiles
| Profile | Use When | Strictness |
|---|---|---|
minimal |
Quick checks during editing | Most permissive |
runtime |
Pre-deployment (RECOMMENDED) | Balanced |
ai-friendly |
AI-generated configs | Reduced false positives |
strict |
Production/critical workflows | Maximum |
validate_node({nodeType: "nodes-base.slack", config: {...}, mode: "full", profile: "runtime"})
Error Severity Levels
Errors (Must Fix) - Blocks execution
missing_required- Required field not providedinvalid_value- Value not in allowed optionstype_mismatch- Wrong data typeinvalid_reference- Referenced node doesn't existinvalid_expression- Expression syntax error
Warnings (Should Fix) - Works but may have issues
best_practice- Recommended configurationdeprecated- Using old API/featureperformance- Potential performance issue
Suggestions (Optional) - Nice to have
optimization- Could be more efficientalternative- Better approach available
The Validation Loop
1. Configure node
↓
2. validate_node (mode: "minimal") - quick check
↓
3. Read errors, fix config
↓
4. validate_node (mode: "full", profile: "runtime")
↓
5. Fix remaining errors
↓
6. Repeat until valid (2-3 iterations typical)
↓
7. validate_workflow - complete workflow check
Common Error Fixes
missing_required
// Error: "Channel name is required"
// Fix: Add the missing field
config.channel = "#general";
invalid_value
// Error: "Operation must be one of: post, update, delete"
config.operation = "post"; // Use valid value
type_mismatch
// Error: "Expected number, got string"
config.limit = 100; // Number, not "100"
invalid_expression
// Error: "Invalid expression: $json.name"
config.text = "={{$json.name}}"; // Add {{}}
invalid_reference
// Error: "Node 'HTTP Requets' does not exist"
config.expression = "={{$node['HTTP Request'].json.data}}"; // Fix typo
Auto-Sanitization System
Runs automatically on ANY workflow update:
What it fixes:
- Binary operators (equals, contains) → removes singleValue
- Unary operators (isEmpty, isNotEmpty) → adds singleValue: true
- IF/Switch metadata → adds conditions.options
What it CANNOT fix:
- Broken connections → Use
cleanStaleConnectionsoperation - Branch count mismatches → Add missing connections
- Paradoxical corrupt states → Manual intervention
Common False Positives (acceptable to ignore)
- "Missing error handling" - OK for simple/test workflows
- "No retry logic" - OK for idempotent operations
- "Missing rate limiting" - OK for internal APIs
- "Unbounded query" - OK for small known datasets
Use ai-friendly profile to reduce false positives.
Recovery Strategies
Start Fresh
When config is severely broken: note required fields from get_node, build minimal config, add incrementally.
Clean Stale Connections
n8n_update_partial_workflow({id, operations: [{type: "cleanStaleConnections"}]})
Auto-fix
n8n_autofix_workflow({id, applyFixes: false}) // Preview
n8n_autofix_workflow({id, applyFixes: true}) // Apply
Best Practices
Do:
- Validate after every significant change
- Read error messages completely (they contain fix guidance)
- Fix errors iteratively (one at a time)
- Use
runtimeprofile for pre-deployment - Trust auto-sanitization for operator issues
Don't:
- Skip validation before activation
- Use
strictduring development (too noisy) - Manually fix auto-sanitization issues
- Deploy with unresolved errors