Webhooks 插件会添加经过身份验证的 HTTP 路由,用于将外部自动化绑定到 OpenClaw TaskFlows。 当你希望 Zapier、n8n、CI 作业或内部服务等受信任系统创建并驱动托管 TaskFlows,而不想先编写自定义插件时,请使用它。Documentation Index
Fetch the complete documentation index at: https://docs2.openclaw.ai/llms.txt
Use this file to discover all available pages before exploring further.
运行位置
Webhooks 插件在 Gateway 网关进程内运行。 如果你的 Gateway 网关运行在另一台机器上,请在该 Gateway 网关主机上安装并配置插件,然后重启 Gateway 网关。配置路由
在plugins.entries.webhooks.config 下设置配置:
enabled:可选,默认为truepath:可选,默认为/plugins/webhooks/<routeId>sessionKey:必需,拥有已绑定 TaskFlows 的会话secret:必需,共享密钥或 SecretRefcontrollerId:可选,用于已创建托管流程的控制器 IDdescription:可选,操作员备注
secret 输入:
- 纯字符串
- SecretRef,带有
source: "env" | "file" | "exec"
安全模型
每个路由都被信任,可以使用其配置的sessionKey 的 TaskFlow 权限执行操作。
这意味着该路由可以检查和变更该会话拥有的 TaskFlows,因此你应该:
- 为每个路由使用强且唯一的密钥
- 优先使用密钥引用,而不是内联明文密钥
- 将路由绑定到符合工作流需求的最小会话
- 只暴露你需要的特定网络钩子路径
- 共享密钥身份验证
- 请求正文大小和超时保护
- 固定窗口速率限制
- 进行中请求限制
- 通过
api.runtime.tasks.managedFlows.bindSession(...)进行绑定所有者的 TaskFlow 访问
请求格式
发送POST 请求,并带上:
Content-Type: application/jsonAuthorization: Bearer <secret>或x-openclaw-webhook-secret: <secret>
支持的操作
插件目前接受这些 JSONaction 值:
create_flowget_flowlist_flowsfind_latest_flowresolve_flowget_task_summaryset_waitingresume_flowfinish_flowfail_flowrequest_cancelcancel_flowrun_task
create_flow
为路由绑定的会话创建托管 TaskFlow。
示例:
run_task
在现有托管 TaskFlow 内创建托管子任务。
允许的运行时为:
subagentacp