codedao12

n8n API

AI 智能体v1.0.1
作者:codedao12更新于 2026-05-11共 2 个版本 · 最新版本发布于 2026-02-01n8n-api@clawhub_codedao12/n8n-api
工作流编排工具调用#N8n#Rest Api

据 AlphaMoat 统计,截至 2026-09,n8n API 累计下载 4,944 次、获 3 个星标,在全部 5,078 个 AI 技能中排名第 1,869 位,在「AI 智能体」分类(969 个)中排名第 348 位。

累计安装
287
累计下载
4,944
星标
3
全站排名
#1,869
全站前 37% · 「AI 智能体」前 36%
平台累计安装累计下载星标评论
ClawHub ↗1614,7593-
SkillHub ↗2874,9443—

各平台的计数口径不同,统计时间不一致。

这个技能是做什么的

该技能让你以编程方式驱动 n8n,覆盖工作流、执行记录、标签、凭据、项目等与 UI 相同的核心操作,支持自托管 n8n 与 n8n Cloud。所有请求需携带 X-N8N-API-KEY 请求头,通过 N8N_API_BASE_URL 与 N8N_API_KEY 环境变量配置。注意:免费试用期间公共 API 不可用,需升级套餐;API playground 仅在自托管实例可用且直接操作真实数据,安全实验应使用测试工作流或独立测试实例;Webhook URL 与 API URL 不同且不使用 API key 请求头;执行记录可能按实例保留设置被清理。

资料发布于 2026-10-29

可以用来做什么

  • 列出、查询、激活或停用 n8n 工作流
  • 查看执行记录列表并重试失败的运行
  • 通过生产或测试 webhook 触发工作流
  • 统计活跃工作流数量与近 24 小时失败执行数

什么时候用

  • 需要在 UI 之外程序化管理 n8n 工作流与执行记录
  • 排查失败执行并定位出错节点
  • 需要对自托管或云端 n8n 实例做健康检查

示例提示词

以下是根据技能文档生成的示例,不代表实际运行结果。

列出我 n8n 实例中所有活跃工作流的名称和 ID
查看最近 5 条失败执行并分析失败节点
重试所选执行记录并报告结果

月度数据趋势

累计下载4,944
3,2914,1795,0662026-03 · 累计下载 3,4132026-05 · 累计下载 4,1162026-06 · 累计下载 4,2772026-07 · 累计下载 4,5692026-08 · 累计下载 4,6672026-09 · 累计下载 4,94426-0326-09
星标3
2342026-03 · 星标 32026-05 · 星标 32026-06 · 星标 32026-07 · 星标 32026-08 · 星标 32026-09 · 星标 326-0326-09

2026-09 起统计方法调整:同名技能按作者分别统计,并覆盖全部技能。图中虚线为调整前的月份,与之后的数据不直接比较,也不计算跨越调整的增长。

月份累计下载环比星标
2026-094,944—3
2026-084,667+2.1%3
2026-074,569+6.8%3
2026-064,277+3.9%3
2026-054,116—3
2026-033,413—3

SKILL.md 原文

以下是作者发布的原始文件,按纯文本显示,本站未做修改或审核;其中的链接不可点击,命令请核实后再运行。抓取于 2026-10-23。

3.7 KB · ClawHub v1.0.1
---
name: n8n-api
description: Operate n8n via its public REST API from OpenClaw. Use for workflow management, executions, and automation tasks such as listing, creating, publishing, triggering, or troubleshooting. Works with both self-hosted n8n and n8n Cloud.
---

# n8n Public REST API

Use this skill when you need to drive n8n programmatically. It covers the same core actions you use in the UI: workflows, executions, tags, credentials, projects, and more.

## Availability
展开全部(共 131 行)
- The public API is unavailable during the free trial.
- Upgrade your plan to enable API access.

## Configuration

Recommended environment variables (or store in `.n8n-api-config`):

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

Create the API key in: n8n Settings → n8n API → Create an API key.

## Auth header

All requests require this header:

```
X-N8N-API-KEY: $N8N_API_KEY
```

## Playground

The API playground is only available on self-hosted n8n and operates on real data. For safe experiments, use a test workflow or a separate test instance.

## Quick actions

### Workflows: list
```bash
curl -s -H "X-N8N-API-KEY: $N8N_API_KEY" "$N8N_API_BASE_URL/workflows" \
  | jq '.data[] | {id, name, active}'
```

### Workflows: details
```bash
curl -s -H "X-N8N-API-KEY: $N8N_API_KEY" "$N8N_API_BASE_URL/workflows/{id}"
```

### Workflows: activate or deactivate
```bash
# Activate (publish)
curl -s -X POST -H "X-N8N-API-KEY: $N8N_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"versionId":"","name":"","description":""}' \
  "$N8N_API_BASE_URL/workflows/{id}/activate"

# Deactivate
curl -s -X POST -H "X-N8N-API-KEY: $N8N_API_KEY" \
  "$N8N_API_BASE_URL/workflows/{id}/deactivate"
```

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

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

### Executions: list
```bash
# Recent executions
curl -s -H "X-N8N-API-KEY: $N8N_API_KEY" \
  "$N8N_API_BASE_URL/executions?limit=10" \
  | jq '.data[] | {id, workflowId, status, startedAt}'

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

### Executions: retry
```bash
curl -s -X POST -H "X-N8N-API-KEY: $N8N_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"loadWorkflow":true}' \
  "$N8N_API_BASE_URL/executions/{id}/retry"
```

## Common flows

### Health check summary
Count active workflows and recent failures:
```bash
ACTIVE=$(curl -s -H "X-N8N-API-KEY: $N8N_API_KEY" \
  "$N8N_API_BASE_URL/workflows?active=true" | jq '.data | length')

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

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

### Debug a failed run
1. List failed executions to get the execution ID.
2. Fetch execution details and identify the failing node.
3. Review node parameters and input data.
4. Suggest a fix based on the error message.

## Endpoint index

See `assets/n8n-api.endpoints.md` for the full list of endpoints.

## REST basics (optional)
If you want a refresher, these are commonly recommended:
- KnowledgeOwl: working with APIs (intro)
- IBM Cloud Learn Hub: what is an API / REST API
- MDN: overview of HTTP

## Notes and tips
- The n8n API node can call the public API from inside workflows.
- Webhook URLs are not the same as API URLs and do not use the API key header.
- Execution records may be pruned based on instance retention settings.

「AI 智能体」分类下的热门技能

codedao12 的其他技能

数据月份:2026-09 · 下载/星标/安装数聚合自公开技能注册库(ClawHub、SkillHub),按月更新。口径说明见数据方法。