OpenClaw + n8n Workflow Orchestration - 工作流编排
让 OpenClaw 通过 n8n webhooks 代理所有外部 API 交互,凭证隔离,可视化工作流。
openclawai-agentsautomationn8ninfrastructure
OpenClaw + n8n Workflow Orchestration
让 OpenClaw 通过 n8n webhooks 代理所有外部 API 交互 — Agent 从不接触凭证。
解决什么问题
当 OpenClaw 直接管理 API 密钥时:
- 无可见性:很难检查 Agent 实际构建了什么
- 凭证蔓延:API Key 在 Agent 环境中,误提交就泄露
- 浪费 tokens:确定性任务燃烧 LLM tokens
架构
OpenClaw → webhook call → n8n Workflow → External Service
(no credentials) (locked, with keys)
如何设置
方式一:预配置 Docker Stack(推荐)
git clone https://github.com/caprihan/openclaw-n8n-stack.git
cd openclaw-n8n-stack
cp .env.template .env
docker-compose up -d
给你 OpenClaw(端口 3456)和 n8n(端口 5678)。
方式二:手动设置
## n8n Integration Pattern
When I need to interact with external APIs:
1. NEVER store API keys in my environment
2. Check if an n8n workflow exists for this integration
3. If not, create one via n8n API with a webhook trigger
4. Notify the user to add credentials and lock the workflow
5. For all future calls, use the webhook URL with a JSON payload
Workflow naming: openclaw-{service}-{action}
Example: openclaw-slack-send-message
成本估算
| 组件 | 成本 |
|---|---|
| n8n(自托管) | 免费 |
| Docker | 免费 |
| 云服务器 | $5-20/月 |