46 lines
2.7 KiB
Markdown
46 lines
2.7 KiB
Markdown
---
|
||
title: "n8n 调用 OpenClaw Agents 的工作流架构"
|
||
type: source
|
||
tags: []
|
||
date: 2026-05-02
|
||
---
|
||
|
||
## Source File
|
||
- [[Agent/n8n 调用openclaw agents的工作流架构.md]]
|
||
|
||
## Summary(用中文描述)
|
||
- 核心主题:n8n 工作流自动化平台如何通过 OpenAI 兼容 API 调用 OpenClaw Agent
|
||
- 问题域:多 Agent 系统集成与工作流编排
|
||
- 方法/机制:通过 OpenClaw Gateway 的 OpenAI Chat Completions 端点,用 HTTP Request 节点调用 Agent,Agent ID 通过 `model` 字段指定(如 `openclaw:main`)
|
||
- 结论/价值:n8n 可同时连接 Hermes Agent(port 8642)和 OpenClaw Agent(port 18789),实现统一的自动化工作流编排
|
||
|
||
## Key Claims(用中文描述)
|
||
- OpenClaw Gateway 的 OpenAI 兼容 Chat Completions 端点**默认关闭**,需要在 `~/.openclaw/openclaw.json` 配置文件中手动开启
|
||
- OpenClaw Agent 通过 `model` 字段指定,格式为 `"openclaw:<agentId>"`(如 `"openclaw:main"` 或 `"openclaw:beta"`)
|
||
- Hermes Agent 与 OpenClaw Agent 的核心区别:默认端口不同(8642 vs 18789)、Agent 指定方式不同
|
||
- n8n 通过 HTTP Request 节点即可同时调用 Hermes Agent 和 OpenClaw Agent,两者共用同一局域网 IP,仅端口不同
|
||
- OpenClaw 配置中的 `host: "0.0.0.0"` 允许 Docker 容器从宿主机网络访问,与 Hermes 的网络配置同理
|
||
|
||
## Key Quotes
|
||
> "OpenClaw 的 Gateway 可以提供 OpenAI 兼容的 Chat Completions 端点,**默认是关闭的**,需要在配置中手动开启" — 配置前提条件
|
||
> "OpenClaw 通过 `model` 字段来指定 Agent ID,格式为 `\"openclaw:<agentId>\"`" — Agent 指定机制
|
||
> "两个都用同一个局域网 IP,只是端口不同,在 n8n 里分别建两个 HTTP Request 节点就可以了" — n8n 集成架构总结
|
||
|
||
## Key Concepts
|
||
- [[OpenAI-Compatible-API]]:OpenClaw Gateway 提供的 OpenAI Chat Completions 兼容端点,用于与标准 AI 工具集成
|
||
- [[HTTP-ChatCompletions]]:HTTP 协议上的 Chat Completions 调用方式,n8n 通过此方式调用 OpenClaw Agent
|
||
- [[Agent-Orchestration]]:多 Agent 系统的编排与管理,n8n 负责协调 Hermes 和 OpenClaw 两个 Agent
|
||
|
||
## Key Entities
|
||
- [[OpenClaw]]:本地运行的 AI Agent 系统,提供 Gateway 服务
|
||
- [[Hermes-Agent]]:另一个本地 AI Agent 系统(端口 8642),n8n 可同时调用
|
||
- [[n8n]]:开源工作流自动化平台,通过 HTTP Request 节点连接多个 AI Agent
|
||
|
||
## Connections
|
||
- [[n8n]] ← calls ← [[OpenAI-Compatible-API]]
|
||
- [[OpenAI-Compatible-API]] ← provided_by ← [[OpenClaw]]
|
||
- [[n8n]] ← also_calls ← [[Hermes-Agent]]
|
||
|
||
## Contradictions
|
||
- 与现有 Wiki 内容暂无冲突(当前 Wiki 中无 OpenClaw 或 n8n 相关页面)
|