Files
nexus/wiki/concepts/Webhook-Proxy-Pattern.md

1.3 KiB
Raw Blame History

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

  1. Agent 通过 n8n API 创建工作流(含 Webhook 触发器)
  2. 管理员在 n8n UI 中添加凭证并锁定工作流
  3. Agent 只需调用 POST http://n8n:5678/webhook/workflow-name 附带 JSON payload
  4. n8n 执行实际 API 调用并返回结果

Connections