← 返回
效率工具 Key

n8n Automation

Manage n8n workflows from OpenClaw via the n8n REST API. Use when the user asks about n8n workflows, automations, executions, or wants to trigger, list, create, activate, or debug n8n workflows. Supports both self-hosted n8n and n8n Cloud instances.
通过 n8n REST API 从 OpenClaw 管理 n8n 工作流。当用户询问 n8n 工作流、自动化、执行情况,或需要触发、列出、创建、激活及调试工作流时使用。支持自托管 n8n 和 n8n Cloud 实例。
dilomcfly
效率工具 clawhub v0.1.0 1 版本 99650.6 Key: 需要
★ 9
Stars
📥 6,094
下载
💾 652
安装
1
版本
#latest

概述

n8n Automation

Control n8n workflow automation platform via REST API.

Setup

Set these environment variables (or store in .n8n-api-config):

export N8N_API_URL="https://your-instance.app.n8n.cloud/api/v1"  # or http://localhost:5678/api/v1
export N8N_API_KEY="your-api-key-here"

Generate API key: n8n Settings → n8n API → Create an API key.

Quick Reference

All calls use header X-N8N-API-KEY for auth.

List Workflows

curl -s -H "X-N8N-API-KEY: $N8N_API_KEY" "$N8N_API_URL/workflows" | jq '.data[] | {id, name, active}'

Get Workflow Details

curl -s -H "X-N8N-API-KEY: $N8N_API_KEY" "$N8N_API_URL/workflows/{id}"

Activate/Deactivate Workflow

# Activate
curl -s -X PATCH -H "X-N8N-API-KEY: $N8N_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"active": true}' "$N8N_API_URL/workflows/{id}"

# Deactivate
curl -s -X PATCH -H "X-N8N-API-KEY: $N8N_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"active": false}' "$N8N_API_URL/workflows/{id}"

Trigger Workflow (via webhook)

# Production webhook
curl -s -X POST "$N8N_API_URL/../webhook/{webhook-path}" \
  -H "Content-Type: application/json" \
  -d '{"key": "value"}'

# Test webhook
curl -s -X POST "$N8N_API_URL/../webhook-test/{webhook-path}" \
  -H "Content-Type: application/json" \
  -d '{"key": "value"}'

List Executions

# All recent executions
curl -s -H "X-N8N-API-KEY: $N8N_API_KEY" "$N8N_API_URL/executions?limit=10" | jq '.data[] | {id, workflowId, status, startedAt}'

# Failed executions only
curl -s -H "X-N8N-API-KEY: $N8N_API_KEY" "$N8N_API_URL/executions?status=error&limit=5"

# Executions for specific workflow
curl -s -H "X-N8N-API-KEY: $N8N_API_KEY" "$N8N_API_URL/executions?workflowId={id}&limit=10"

Get Execution Details

curl -s -H "X-N8N-API-KEY: $N8N_API_KEY" "$N8N_API_URL/executions/{id}"

Create Workflow (from JSON)

curl -s -X POST -H "X-N8N-API-KEY: $N8N_API_KEY" \
  -H "Content-Type: application/json" \
  -d @workflow.json "$N8N_API_URL/workflows"

Delete Workflow

curl -s -X DELETE -H "X-N8N-API-KEY: $N8N_API_KEY" "$N8N_API_URL/workflows/{id}"

Common Patterns

Health Check (run periodically)

List active workflows, check recent executions for errors, report status:

# Count active workflows
ACTIVE=$(curl -s -H "X-N8N-API-KEY: $N8N_API_KEY" "$N8N_API_URL/workflows?active=true" | jq '.data | length')

# Count failed executions (last 24h)
FAILED=$(curl -s -H "X-N8N-API-KEY: $N8N_API_KEY" "$N8N_API_URL/executions?status=error&limit=100" | jq '[.data[] | select(.startedAt > (now - 86400 | todate))] | length')

echo "Active workflows: $ACTIVE | Failed (24h): $FAILED"

Debug Failed Execution

  1. List failed executions → get execution ID
  2. Fetch execution details → find the failing node
  3. Check node parameters and input data
  4. Suggest fix based on error message

Workflow Summary

Parse workflow JSON to summarize: trigger type, node count, apps connected, schedule.

API Endpoints Reference

See references/api-endpoints.md for complete endpoint documentation.

Tips

  • API key has full access on non-enterprise plans
  • Rate limits vary by plan (cloud) or are unlimited (self-hosted)
  • Webhook URLs are separate from API URLs (no auth header needed)
  • Use ?active=true or ?active=false to filter workflow listings
  • Execution data may be pruned based on n8n retention settings

版本历史

共 1 个版本

  • v0.1.0 当前
    2026-03-28 09:51 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

productivity

Weather

steipete
获取当前天气和预报(无需API密钥)
★ 445 📥 226,127
productivity

Word / DOCX

ivangdavila
创建、检查和编辑 Microsoft Word 文档及 DOCX 文件,支持样式、编号、修订记录、表格、分节符及兼容性检查等功能。
★ 438 📥 147,229
productivity

Nano Pdf

steipete
使用nano-pdf CLI通过自然语言指令编辑PDF
★ 275 📥 114,742