title, type, tags, sources, last_updated
| title |
type |
tags |
sources |
last_updated |
| Webhook-Proxy-Pattern |
concept |
| webhook |
| security |
| agent-architecture |
| n8n |
|
| n8n-workflow-orchestration |
|
2026-04-17 |
Aliases
- Webhook Proxy Pattern
- Webhook 代理模式
Definition
一种 AI Agent 外部 API 调用架构:Agent 不直接持有凭证,而是通过调用 n8n Webhook URL 触发工作流,n8n 在服务端持有 API 凭证并执行实际 API 调用。Agent 只知道 Webhook 端点,不知道任何密钥。
Why It Matters
- 安全性:API 密钥从不进入 Agent 环境,一次误提交也不会泄露
- 可观测性:n8n 记录每次调用的输入输出
- 可治理:工作流可被锁定,Agent 无法静默修改 API 行为
- 可测试:工作流可在 n8n UI 中独立调试
How It Works
- Agent 通过 n8n API 创建工作流(含 Webhook 触发器)
- 管理员在 n8n UI 中添加凭证并锁定工作流
- Agent 只需调用
POST http://n8n:5678/webhook/workflow-name 附带 JSON payload
- n8n 执行实际 API 调用并返回结果
Connections