docs/plugins/webhooks.md
The Webhooks plugin adds authenticated HTTP routes that bind external automation to OpenClaw TaskFlows.
Use it when you want a trusted system such as Zapier, n8n, a CI job, or an internal service to create and drive managed TaskFlows without writing a custom plugin first.
The Webhooks plugin runs inside the Gateway process.
If your Gateway runs on another machine, install and configure the plugin on that Gateway host, then restart the Gateway.
Set config under plugins.entries.webhooks.config:
{
plugins: {
entries: {
webhooks: {
enabled: true,
config: {
routes: {
zapier: {
path: "/plugins/webhooks/zapier",
sessionKey: "agent:main:main",
secret: {
source: "env",
provider: "default",
id: "OPENCLAW_WEBHOOK_SECRET",
},
controllerId: "webhooks/zapier",
description: "Zapier TaskFlow bridge",
},
},
},
},
},
},
}
Route fields:
enabled: optional, defaults to truepath: optional, defaults to /plugins/webhooks/<routeId>sessionKey: required session that owns the bound TaskFlowssecret: required shared secret or SecretRefcontrollerId: optional controller id for created managed flowsdescription: optional operator noteSupported secret inputs:
source: "env" | "file" | "exec"If a secret-backed route cannot resolve its secret at startup, the plugin skips that route and logs a warning instead of exposing a broken endpoint.
Each route is trusted to act with the TaskFlow authority of its configured
sessionKey.
This means the route can inspect and mutate TaskFlows owned by that session, so you should:
The plugin applies:
api.runtime.tasks.managedFlows.bindSession(...)Send POST requests with:
Content-Type: application/jsonAuthorization: Bearer <secret> or x-openclaw-webhook-secret: <secret>Example:
curl -X POST https://gateway.example.com/plugins/webhooks/zapier \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer YOUR_SHARED_SECRET' \
-d '{"action":"create_flow","goal":"Review inbound queue"}'
The plugin currently accepts these JSON action values:
create_flowget_flowlist_flowsfind_latest_flowresolve_flowget_task_summaryset_waitingresume_flowfinish_flowfail_flowrequest_cancelcancel_flowrun_taskcreate_flowCreates a managed TaskFlow for the route's bound session.
Example:
{
"action": "create_flow",
"goal": "Review inbound queue",
"status": "queued",
"notifyPolicy": "done_only"
}
run_taskCreates a managed child task inside an existing managed TaskFlow.
Allowed runtimes are:
subagentacpExample:
{
"action": "run_task",
"flowId": "flow_123",
"runtime": "acp",
"childSessionKey": "agent:main:acp:worker",
"task": "Inspect the next message batch"
}
Successful responses return:
{
"ok": true,
"routeId": "zapier",
"result": {}
}
Rejected requests return:
{
"ok": false,
"routeId": "zapier",
"code": "not_found",
"error": "TaskFlow not found.",
"result": {}
}
The plugin intentionally scrubs owner/session metadata from webhook responses.