Documentation Index
Fetch the complete documentation index at: https://docs.openclaw.ai/llms.txt
Use this file to discover all available pages before exploring further.
Webhook(Plugin)
Webhooks Plugin 會新增經過驗證的 HTTP 路由,將外部自動化綁定到 OpenClaw TaskFlows。 當你想讓受信任的系統(例如 Zapier、n8n、CI 工作,或內部服務)建立並驅動受管理的 TaskFlows,而不必先撰寫自訂 Plugin 時,請使用它。執行位置
Webhooks Plugin 會在 Gateway 程序內執行。 如果你的 Gateway 在另一台機器上執行,請在該 Gateway 主機上安裝並設定 Plugin,然後重新啟動 Gateway。設定路由
在plugins.entries.webhooks.config 下設定 config:
enabled:選用,預設為truepath:選用,預設為/plugins/webhooks/<routeId>sessionKey:必要,擁有綁定 TaskFlows 的 sessionsecret:必要,共用密鑰或 SecretRefcontrollerId:選用,為建立的受管理流程指定 controller iddescription:選用,操作者備註
secret 輸入:
- 純字串
- SecretRef,搭配
source: "env" | "file" | "exec"
安全模型
每個路由都被信任,可使用其設定的sessionKey 的 TaskFlow 權限執行操作。
這表示該路由可以檢查並變更該 session 擁有的 TaskFlows,因此你應該:
- 為每個路由使用強而唯一的密鑰
- 優先使用密鑰參照,而不是內嵌純文字密鑰
- 將路由綁定到符合工作流程的最小範圍 session
- 只暴露你需要的特定 Webhook 路徑
- 共用密鑰驗證
- 請求主體大小與逾時防護
- 固定時間窗速率限制
- 進行中請求限制
- 透過
api.runtime.tasks.managedFlows.bindSession(...)進行受擁有者限制的 TaskFlow 存取
請求格式
傳送POST 請求,並包含:
Content-Type: application/jsonAuthorization: Bearer <secret>或x-openclaw-webhook-secret: <secret>
支援的動作
Plugin 目前接受這些 JSONaction 值:
create_flowget_flowlist_flowsfind_latest_flowresolve_flowget_task_summaryset_waitingresume_flowfinish_flowfail_flowrequest_cancelcancel_flowrun_task
create_flow
為路由綁定的 session 建立受管理的 TaskFlow。
範例:
run_task
在現有受管理的 TaskFlow 內建立受管理的子任務。
允許的執行階段為:
subagentacp