openclaw/docs/automation
Bill Chirico ca629296c6
feat(hooks): add agentId support to webhook mappings (#13672)
* feat(hooks): add agentId support to webhook mappings

Allow webhook mappings to route hook runs to a specific agent via
the new `agentId` field. This enables lightweight agents with minimal
bootstrap files to handle webhooks, reducing token cost per hook run.

The agentId is threaded through:
- HookMappingConfig (config type + zod schema)
- HookMappingResolved + HookAction (mapping types)
- normalizeHookMapping + buildActionFromMapping (mapping logic)
- mergeAction (transform override support)
- HookAgentPayload + normalizeAgentPayload (direct /hooks/agent endpoint)
- dispatchAgentHook → CronJob.agentId (server dispatch)

The existing runCronIsolatedAgentTurn already supports agentId on
CronJob — this change simply wires it through from webhook mappings.

Usage in config:
  hooks.mappings[].agentId = "my-agent"

Usage via POST /hooks/agent:
  { "message": "...", "agentId": "my-agent" }

Includes tests for mapping passthrough and payload normalization.
Includes doc updates for webhook.md.

* fix(hooks): enforce webhook agent routing policy + docs/changelog updates (#13672) (thanks @BillChirico)

* fix(hooks): harden explicit agent allowlist semantics (#13672) (thanks @BillChirico)

---------

Co-authored-by: Pip <pip@openclaw.ai>
Co-authored-by: Gustavo Madeira Santana <gumadeiras@gmail.com>
2026-02-10 19:23:58 -05:00
..
auth-monitoring.md Docs: add nav titles across docs (#5689) 2026-01-31 15:04:03 -06:00
cron-jobs.md fix(cron): share isolated announce flow + harden cron scheduling/delivery (#11641) 2026-02-07 19:46:01 -08:00
cron-vs-heartbeat.md feat(cron): enhance delivery modes and job configuration 2026-02-04 01:03:59 -08:00
gmail-pubsub.md revert(docs): undo markdownlint autofix churn 2026-02-06 10:00:08 -05:00
hooks.md docs: canonicalize docs paths and align zh navigation (#11428) 2026-02-07 15:40:35 -05:00
poll.md Docs: add nav titles across docs (#5689) 2026-01-31 15:04:03 -06:00
troubleshooting.md docs: add symptom-first troubleshooting hub and deep runbooks (#11196) 2026-02-07 10:28:19 -05:00
webhook.md feat(hooks): add agentId support to webhook mappings (#13672) 2026-02-10 19:23:58 -05:00