n8nManage 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.
Install via ClawdBot CLI:
clawdbot install thomasansems/n8nComprehensive 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) ā Response
Example 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:
{
"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):
export N8N_API_KEY="your-api-key-here"
export N8N_BASE_URL="your-n8n-url-here"
Verify connection:
python3 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.
python3 scripts/n8n_api.py list-workflows --pretty
python3 scripts/n8n_api.py list-workflows --active true --pretty
python3 scripts/n8n_api.py get-workflow --id <workflow-id> --pretty
# From JSON file
python3 scripts/n8n_api.py create --from-file workflow.json
python3 scripts/n8n_api.py activate --id <workflow-id>
python3 scripts/n8n_api.py deactivate --id <workflow-id>
# 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>
# 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
# Run multiple test cases
python3 scripts/n8n_tester.py test-suite --id <workflow-id> --test-suite test-cases.json
# 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
python3 scripts/n8n_api.py get-execution --id <execution-id> --pretty
# 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"}'
# 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
# Priority-ranked suggestions
python3 scripts/n8n_optimizer.py suggest --id <workflow-id> --pretty
# Human-readable report with metrics, bottlenecks, and suggestions
python3 scripts/n8n_optimizer.py report --id <workflow-id>
# Execution statistics
python3 scripts/n8n_api.py stats --id <workflow-id> --days 7 --pretty
from 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'})
from 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)
from 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)
# 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>
# 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>
# 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
# 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 environment
Solution: Set environment variable:
export N8N_API_KEY="your-api-key"
Error: HTTP 401: Unauthorized
Solution:
Validation failed: Node missing 'name' field
Solution: Check workflow JSON structure, ensure all required fields present
Status: timeout - Execution did not complete
Solution:
Error: HTTP 429: Too Many Requests
Solution:
Warning: Node 'HTTP_Request' may require credentials
Solution:
~/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 reference
For 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 python3 scripts/n8n_api.py get-execution --id python3 scripts/n8n_optimizer.py report --id python3 scripts/n8n_tester.py dry-run --id --data-file test.json Generated Mar 1, 2026
Automatically process new orders from an e-commerce platform like Shopify by fetching order details, updating inventory in a database, and sending confirmation emails to customers. This workflow reduces manual data entry and ensures timely order fulfillment.
Schedule and publish posts across multiple social media platforms such as Twitter, LinkedIn, and Facebook. The workflow can pull content from a CMS, format it for each platform, and handle posting at optimal times to increase engagement.
Automate the handling of customer support tickets by integrating with tools like Zendesk or Freshdesk. The workflow can categorize tickets, assign them to agents based on priority, and send automated responses for common queries.
Set up automated backups for critical data from cloud storage services like Google Drive or Dropbox to a secure server or another cloud provider. This workflow ensures data redundancy and compliance with retention policies.
Monitor IoT sensors for environmental data such as temperature or humidity, process the readings, and trigger alerts via email or SMS if thresholds are exceeded. This helps in proactive maintenance and safety management.
Offer n8n workflow automation as a service to businesses looking to integrate their SaaS tools without coding. Charge a monthly subscription fee for setup, maintenance, and custom workflow development, targeting small to medium enterprises.
Provide consulting services to help companies implement n8n for their automation needs, including workflow design, optimization, and staff training. Revenue comes from hourly rates or project-based fees, focusing on industries like finance or healthcare.
Create and sell pre-built n8n workflow templates for common use cases such as lead generation or data synchronization. Monetize through one-time purchases or a subscription model for access to a library of templates, appealing to freelancers and startups.
š¬ Integration Tip
Ensure all API keys are securely stored in environment variables and test workflows thoroughly with dry runs before activation to avoid disruptions.
A fast Rust-based headless browser automation CLI with Node.js fallback that enables AI agents to navigate, click, type, and snapshot pages via structured commands.
Automate web browser interactions using natural language via CLI commands. Use when the user asks to browse websites, navigate web pages, extract data from websites, take screenshots, fill forms, click buttons, or interact with web applications.
Advanced desktop automation with mouse, keyboard, and screen control
Design and implement automation workflows to save time and scale operations as a solopreneur. Use when identifying repetitive tasks to automate, building workflows across tools, setting up triggers and actions, or optimizing existing automations. Covers automation opportunity identification, workflow design, tool selection (Zapier, Make, n8n), testing, and maintenance. Trigger on "automate", "automation", "workflow automation", "save time", "reduce manual work", "automate my business", "no-code automation".
Browser automation via Playwright MCP server. Navigate websites, click elements, fill forms, extract data, take screenshots, and perform full browser automation workflows.
API-first email platform designed for AI agents. Create and manage dedicated email inboxes, send and receive emails programmatically, and handle email-based workflows with webhooks and real-time events. Use when you need to set up agent email identity, send emails from agents, handle incoming email workflows, or replace traditional email providers like Gmail with agent-friendly infrastructure.