Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Manage n8n workflows and automations via API. Use when working with n8n workflows, executions, or automation tasks - listing workflows, activating/deactivating, checking execution status, manually triggering workflows, or debugging automation issues.
.claude/skills/leoyeai-n8n/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-04 | ✗→✓ | ▲ Improved | 111% | 0% |
| case-05 | ✗→✓ | ▲ Improved | 100% | 0% |
| case-06 | ✗→✓ | ▲ Improved | 182% | 0% |
| case-07 | ✗→✓ | ▲ Improved | 243% | 0% |
| case-08 | ✗→✓ | ▲ Improved | 29% | 0% |
Comprehensive workflow automation management for n8n platform with creation, testing, execution monitoring, and performance optimization capabilities.
When creating n8n workflows, ALWAYS:
NEVER:
Example GOOD workflow:
Manual Trigger → Set Config → HTTP Request (API call) → Code (parse) → ResponseExample BAD workflow:
Manual Trigger → Code ("Add HTTP nodes here, configure APIs...")Always build the complete, functional workflow with all necessary nodes configured and connected.
Required environment variables:
N8N_API_KEY — Your n8n API key (Settings → API in the n8n UI)N8N_BASE_URL — Your n8n instance URLConfigure credentials via OpenClaw settings:
Add to ~/.config/openclaw/settings.json:
json{ "skills": { "n8n": { "env": { "N8N_API_KEY": "your-api-key-here", "N8N_BASE_URL": "your-n8n-url-here" } } } }
Or set per-session (do not persist secrets in shell rc files):
bashexport N8N_API_KEY="your-api-key-here" export N8N_BASE_URL="your-n8n-url-here"
Verify connection:
bashpython3 scripts/n8n_api.py list-workflows --pretty
> Security note: Never store API keys in plaintext shell config files (~/.bashrc, ~/.zshrc). Use the OpenClaw settings file or a secure secret manager.
bashpython3 scripts/n8n_api.py list-workflows --pretty python3 scripts/n8n_api.py list-workflows --active true --pretty
bashpython3 scripts/n8n_api.py get-workflow --id <workflow-id> --pretty
bash# From JSON file python3 scripts/n8n_api.py create --from-file workflow.json
bashpython3 scripts/n8n_api.py activate --id <workflow-id> python3 scripts/n8n_api.py deactivate --id <workflow-id>
bash# Validate existing workflow python3 scripts/n8n_tester.py validate --id <workflow-id> # Validate from file python3 scripts/n8n_tester.py validate --file workflow.json --pretty # Generate validation report python3 scripts/n8n_tester.py report --id <workflow-id>
bash# Test with data python3 scripts/n8n_tester.py dry-run --id <workflow-id> --data '{"email": "test@example.com"}' # Test with data file python3 scripts/n8n_tester.py dry-run --id <workflow-id> --data-file test-data.json # Full test report (validation + dry run) python3 scripts/n8n_tester.py dry-run --id <workflow-id> --data-file test.json --report
bash# Run multiple test cases python3 scripts/n8n_tester.py test-suite --id <workflow-id> --test-suite test-cases.json
bash# Recent executions (all workflows) python3 scripts/n8n_api.py list-executions --limit 10 --pretty # Specific workflow executions python3 scripts/n8n_api.py list-executions --id <workflow-id> --limit 20 --pretty
bashpython3 scripts/n8n_api.py get-execution --id <execution-id> --pretty
bash# Trigger workflow python3 scripts/n8n_api.py execute --id <workflow-id> # Execute with data python3 scripts/n8n_api.py execute --id <workflow-id> --data '{"key": "value"}'
bash# Full performance analysis python3 scripts/n8n_optimizer.py analyze --id <workflow-id> --pretty # Analyze specific period python3 scripts/n8n_optimizer.py analyze --id <workflow-id> --days 30 --pretty
bash# Priority-ranked suggestions python3 scripts/n8n_optimizer.py suggest --id <workflow-id> --pretty
bash# Human-readable report with metrics, bottlenecks, and suggestions python3 scripts/n8n_optimizer.py report --id <workflow-id>
bash# Execution statistics python3 scripts/n8n_api.py stats --id <workflow-id> --days 7 --pretty
pythonfrom scripts.n8n_api import N8nClient client = N8nClient() # List workflows workflows = client.list_workflows(active=True) # Get workflow workflow = client.get_workflow('workflow-id') # Create workflow new_workflow = client.create_workflow({ 'name': 'My Workflow', 'nodes': [...], 'connections': {...} }) # Activate/deactivate client.activate_workflow('workflow-id') client.deactivate_workflow('workflow-id') # Executions executions = client.list_executions(workflow_id='workflow-id', limit=10) execution = client.get_execution('execution-id') # Execute workflow result = client.execute_workflow('workflow-id', data={'key': 'value'})
pythonfrom scripts.n8n_api import N8nClient from scripts.n8n_tester import WorkflowTester client = N8nClient() tester = WorkflowTester(client) # Validate workflow validation = tester.validate_workflow(workflow_id='123') print(f"Valid: {validation['valid']}") print(f"Errors: {validation['errors']}") print(f"Warnings: {validation['warnings']}") # Dry run result = tester.dry_run( workflow_id='123', test_data={'email': 'test@example.com'} ) print(f"Status: {result['status']}") # Test suite test_cases = [ {'name': 'Test 1', 'input': {...}, 'expected': {...}}, {'name': 'Test 2', 'input': {...}, 'expected': {...}} ] results = tester.test_suite('123', test_cases) print(f"Passed: {results['passed']}/{results['total_tests']}") # Generate report report = tester.generate_test_report(validation, result) print(report)
pythonfrom scripts.n8n_optimizer import WorkflowOptimizer optimizer = WorkflowOptimizer() # Analyze performance analysis = optimizer.analyze_performance('workflow-id', days=7) print(f"Performance Score: {analysis['performance_score']}/100") print(f"Health: {analysis['execution_metrics']['health']}") # Get suggestions suggestions = optimizer.suggest_optimizations('workflow-id') print(f"Priority Actions: {len(suggestions['priority_actions'])}") print(f"Quick Wins: {len(suggestions['quick_wins'])}") # Generate report report = optimizer.generate_optimization_report(analysis) print(report)
bash# Validate workflow structure python3 scripts/n8n_tester.py validate --id <workflow-id> --pretty # Test with sample data python3 scripts/n8n_tester.py dry-run --id <workflow-id> \ --data '{"email": "test@example.com", "name": "Test User"}' # If tests pass, activate python3 scripts/n8n_api.py activate --id <workflow-id>
bash# Check recent executions python3 scripts/n8n_api.py list-executions --id <workflow-id> --limit 10 --pretty # Get specific execution details python3 scripts/n8n_api.py get-execution --id <execution-id> --pretty # Validate workflow structure python3 scripts/n8n_tester.py validate --id <workflow-id> # Generate test report python3 scripts/n8n_tester.py report --id <workflow-id> # Check for optimization issues python3 scripts/n8n_optimizer.py report --id <workflow-id>
bash# Analyze current performance python3 scripts/n8n_optimizer.py analyze --id <workflow-id> --days 30 --pretty # Get actionable suggestions python3 scripts/n8n_optimizer.py suggest --id <workflow-id> --pretty # Generate comprehensive report python3 scripts/n8n_optimizer.py report --id <workflow-id> # Review execution statistics python3 scripts/n8n_api.py stats --id <workflow-id> --days 30 --pretty # Test optimizations with dry run python3 scripts/n8n_tester.py dry-run --id <workflow-id> --data-file test-data.json
bash# Check active workflows python3 scripts/n8n_api.py list-workflows --active true --pretty # Review recent execution status python3 scripts/n8n_api.py list-executions --limit 20 --pretty # Get statistics for each critical workflow python3 scripts/n8n_api.py stats --id <workflow-id> --pretty # Generate health reports python3 scripts/n8n_optimizer.py report --id <workflow-id>
The testing module performs comprehensive validation:
The optimizer analyzes multiple dimensions:
Workflows receive a performance score (0-100) based on:
Score interpretation:
Error: N8N_API_KEY not found in environmentSolution: Set environment variable:
bashexport N8N_API_KEY="your-api-key"
Error: HTTP 401: UnauthorizedSolution:
Validation failed: Node missing 'name' fieldSolution: Check workflow JSON structure, ensure all required fields present
Status: timeout - Execution did not completeSolution:
Error: HTTP 429: Too Many RequestsSolution:
Warning: Node 'HTTP_Request' may require credentialsSolution:
~/clawd/skills/n8n/
├── SKILL.md # This file
├── scripts/
│ ├── n8n_api.py # Core API client (extended)
│ ├── n8n_tester.py # Testing & validation
│ └── n8n_optimizer.py # Performance optimization
└── references/
└── api.md # n8n API referenceFor detailed n8n REST API documentation, see references/api.md or visit: https://docs.n8n.io/api/
Documentation:
Debugging:
python3 scripts/n8n_tester.py validate --id <workflow-id>python3 scripts/n8n_api.py get-execution --id <execution-id>python3 scripts/n8n_optimizer.py report --id <workflow-id>python3 scripts/n8n_tester.py dry-run --id <workflow-id> --data-file test.json| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-22 | pass→pass | 14,679 | 13,170 | -10% | 1 | 1 | 0% | 2,938 | 7,168 | +144% | 0 | 0 | — |
case-23 | pass→pass | 12,313 | 7,001 | -43% | 1 | 1 | 0% | 2,358 | 5,339 | +126% | 0 | 0 | — |
case-01 | fail→fail | 22,921 | 5,971 | -74% | 1 | 1 | 0% | 4,003 | 4,314 | +8% | 0 | 0 | — |
case-02 | fail→fail | 8,921 | 5,660 | -37% | 1 | 1 | 0% | 1,790 | 4,359 | +144% | 0 | 0 | — |
case-03 | pass→pass | 22,685 | 16,247 | -28% | 1 | 1 | 0% | 4,984 | 7,882 | +58% | 0 | 0 | — |
case-04 | fail→pass | 12,657 | 4,950 | -61% | 1 | 1 | 0% | 2,307 | 4,878 | +111% | 0 | 0 | — |
case-05 | fail→pass | 11,431 | 2,349 | -79% | 1 | 1 | 0% | 2,166 | 4,331 | +100% | 0 | 0 | — |
case-06 | fail→pass | 10,400 | 6,403 | -38% | 1 | 1 | 0% | 1,816 | 5,120 | +182% | 0 | 0 | — |
case-07 | fail→pass | 6,306 | 3,122 | -50% | 1 | 1 | 0% | 1,296 | 4,447 | +243% | 0 | 0 | — |
case-08 | fail→pass | 17,433 | 2,282 | -87% | 1 | 1 | 0% | 3,331 | 4,282 | +29% | 0 | 0 | — |
case-09 | fail→pass | 14,885 | 5,146 | -65% | 1 | 1 | 0% | 2,997 | 4,958 | +65% | 0 | 0 | — |
case-10 | fail→pass | 11,416 | 1,716 | -85% | 1 | 1 | 0% | 2,050 | 4,187 | +104% | 0 | 0 | — |
case-11 | fail→pass | 9,679 | 2,497 | -74% | 1 | 1 | 0% | 1,711 | 4,261 | +149% | 0 | 0 | — |
case-12 | fail→fail | 8,885 | 5,868 | -34% | 1 | 1 | 0% | 1,565 | 4,219 | +170% | 0 | 0 | — |
case-13 | fail→fail | 6,005 | 5,363 | -11% | 1 | 1 | 0% | 946 | 4,250 | +349% | 0 | 0 | — |
case-14 | fail→pass | 7,436 | 5,666 | -24% | 1 | 1 | 0% | 1,312 | 4,278 | +226% | 0 | 0 | — |
case-15 | fail→pass | 11,969 | 4,510 | -62% | 1 | 1 | 0% | 2,324 | 4,975 | +114% | 0 | 0 | — |
case-16 | fail→pass | 8,436 | 4,579 | -46% | 1 | 1 | 0% | 1,536 | 4,919 | +220% | 0 | 0 | — |
case-17 | fail→pass | 9,640 | 4,608 | -52% | 1 | 1 | 0% | 1,735 | 4,863 | +180% | 0 | 0 | — |
case-18 | fail→pass | 10,065 | 5,373 | -47% | 1 | 1 | 0% | 1,869 | 4,968 | +166% | 0 | 0 | — |
case-19 | fail→pass | 8,887 | 4,433 | -50% | 1 | 1 | 0% | 1,392 | 4,805 | +245% | 0 | 0 | — |
case-20 | fail→pass | 6,632 | 2,068 | -69% | 1 | 1 | 0% | 1,004 | 4,223 | +321% | 0 | 0 | — |
case-21 | pass→pass | 12,888 | 12,043 | -7% | 1 | 1 | 0% | 2,635 | 6,394 | +143% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 23 cases were attempted, and 19 counted toward the lift figure. The other 4 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of +65 percentage points is the difference between those two pass rates over the 19 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.