通过 API 管理 n8n 工作流程和自动化。在处理 n8n 工作流程、执行或自动化任务时使用 - 列出工作流程、激活/停用、检查执行状态、手动触发工作流程或调试自动化问题。
数据来源:ClawHub。 在 ClawSkills 查看
选择你使用的 Agent
方法一:命令行安装(推荐)
推荐(无需提前安装 clawhub)
npx clawhub@latest --dir ~/.claude/skills install n8n或使用 clawhub CLI(需提前安装)
clawhub --dir ~/.claude/skills install n8n⚠️ 需要 Node.js 18+,没有 Node?请使用下方方法二直接下载 ZIP。 安装 Node.js →
方法二:手动下载安装(无需 Node)
下载 ZIP,解压后将文件夹放到以下路径,重启 Agent 即可:
安装路径
~/.claude/skills/n8n/💡解压后将文件夹放到上方路径,重启 Agent 即可生效
--- name: n8n description: 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. metadata: {"openclaw":{"emoji":"\u2699\ufe0f","requires":{"env":["N8N_API_KEY","N8N_BASE_URL"]},"primaryEnv":"N8N_API_KEY"}} ---
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) → 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": "[email protected]"}'
# 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': '[email protected]'}
)
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": "[email protected]", "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
...安装 n8n 后,可以对 AI 说这些话来触发它
Help me get started with n8n
Explains what n8n does, walks through the setup, and runs a quick demo based on your current project
Use n8n to manage n8n workflows and automations via API
Invokes n8n with the right parameters and returns the result directly in the conversation
What can I do with n8n in my developer & devops workflow?
Lists the top use cases for n8n, with example commands for each scenario
将技能文件夹放到 ~/.claude/skills/n8n/ 目录(个人级,所有项目可用),或 .claude/skills/n8n/(项目级)。重启 AI 客户端后,用 /n8n 主动调用,或让 AI 根据上下文自动发现并使用。
n8n 支持 Claude、Cursor、OpenClaw,可与这些 AI 平台无缝集成,扩展其能力。
n8n 可免费安装使用。请查阅仓库了解许可证信息。
通过 API 管理 n8n 工作流程和自动化。在处理 n8n 工作流程、执行或自动化任务时使用 - 列出工作流程、激活/停用、检查执行状态、手动触发工作流程或调试自动化问题。
n8n 属于「Developer & DevOps」分类,该分类的技能帮助 AI 智能体在此领域执行专业任务。
Automate my developer & devops tasks using n8n
Identifies repetitive steps in your workflow and sets up n8n to handle them automatically