Webhooks Plugin 會新增已驗證的 HTTP 路由,將外部自動化綁定到 OpenClaw TaskFlow。 當你想讓 Zapier、n8n、CI 作業或內部服務等受信任系統建立並驅動受管理的 TaskFlow,而不想先撰寫自訂 Plugin 時,請使用它。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 Plugin 會在 Gateway 程序內執行。 如果你的 Gateway 在另一台機器上執行,請在該 Gateway 主機上安裝並設定 Plugin,然後重新啟動 Gateway。設定路由
在plugins.entries.webhooks.config 下設定 config:
enabled:選用,預設為truepath:選用,預設為/plugins/webhooks/<routeId>sessionKey:必要,擁有已綁定 TaskFlow 的 sessionsecret:必要,共用密鑰或 SecretRefcontrollerId:選用,供已建立受管理流程使用的 controller iddescription:選用,操作員註記
secret 輸入:
- 純文字字串
- SecretRef,搭配
source: "env" | "file" | "exec"
安全模型
每個路由都會被信任,可使用其設定的sessionKey 的 TaskFlow 權限執行操作。
這表示該路由可以檢查並變更該 session 擁有的 TaskFlow,因此你應該:
- 為每個路由使用強式且唯一的密鑰
- 優先使用密鑰參照,而不是內嵌純文字密鑰
- 將路由綁定到符合工作流程的最小範圍 session
- 只暴露你需要的特定 Webhook 路徑
- 共用密鑰驗證
- 請求 body 大小與逾時防護
- 固定視窗速率限制
- 進行中請求限制
- 透過
api.runtime.tasks.managedFlows.bindSession(...)進行的 owner 綁定 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 內建立受管理的子任務。
允許的 runtime 為:
subagentacp