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
累計下載
4944
星標
3
全站排名
#1,869
全站前 37% · 「AI 智慧體」前 36%
平台累計安裝累計下載星標評論
ClawHub ↗16147593-
SkillHub ↗28749443—

各平台的計數口徑不同,統計時間不一致。

這個技能是做什麼的

該技能讓你以程式設計方式驅動 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 條失敗執行並分析失敗節點
重試所選執行記錄並報告結果

月度資料趨勢

累計下載4944
3291417950662026-03 · 累計下載 34132026-05 · 累計下載 41162026-06 · 累計下載 42772026-07 · 累計下載 45692026-08 · 累計下載 46672026-09 · 累計下載 494426-0326-09
星標3
2342026-03 · 星標 32026-05 · 星標 32026-06 · 星標 32026-07 · 星標 32026-08 · 星標 32026-09 · 星標 326-0326-09

2026-09 起統計方法調整:同名技能按作者分別統計,並覆蓋全部技能。圖中虛線為調整前的月份,與之後的資料不直接比較,也不計算跨越調整的增長。

月份累計下載環比星標
2026-094944—3
2026-084667+2.1%3
2026-074569+6.8%3
2026-064277+3.9%3
2026-054116—3
2026-033413—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),按月更新。口徑說明見資料方法。