Skip to main content

Webhooks & Event Destinations

Push agent events to external systems automatically. The webhook system listens to the agent’s EventBus and forwards events to configured destinations with retry and batching.

Quick Start

Destinations

HTTP

The payload is JSON: { event, payload, timestamp }. With a secret, the X-Webhook-Signature header contains sha256=<hex>.

Slack

Default format:

Email (SendGrid)

Custom Destination

Build your own destination by implementing the WebhookDestination interface:

Configuration

Supported Events

All events from the AgentEventMap are supported, including: run.start, run.complete, run.error, tool.call, tool.result, team.delegate, handoff.transfer, handoff.complete, cost.tracked, cache.hit, cache.miss, memory.stored, skill.loaded, and more.

Event Filtering

Only forward specific events to specific destinations:
Only the listed events are forwarded. Omit events to forward everything.

Batching

For high-throughput agents, batch events before sending to reduce HTTP calls:
Batched events are sent as an array in a single HTTP request. The batch flushes either when batchInterval elapses or when 100 events accumulate (whichever comes first).

HMAC Signature Verification

When using httpWebhook with a secret, every request includes a X-Webhook-Signature header. Verify it on your server: