-
Notifications
You must be signed in to change notification settings - Fork 11
primitives webhook delivery
Magnus Hedemark edited this page Jun 10, 2026
·
1 revision
Active contributors: groktopus
The webhook system delivers asynchronous job completion and failure notifications to external URLs. It supports HMAC-SHA256 signing, event filtering, and exponential backoff retries.
- After
store.complete_job()orstore.fail_job(), the worker callsdeliver_webhook() - The function checks if a webhook URL is configured and if the event matches the filter
- A JSON payload with
event,id, anddatafields is POSTed to the URL - The webhook secret (from
WEBHOOK_SECRETenv var) is used for HMAC-SHA256 signing, sent asX-Webhook-Signatureheader
- Up to 3 attempts
- Exponential backoff: 2s, 4s
- 5 second timeout per attempt
- Server errors (500+) and timeouts trigger retries
Webhook configs can include an events list. When provided, the webhook only fires for matching event types. Example:
{"url": "https://example.com/hook", "events": ["completed"]}| File | Purpose |
|---|---|
agent-svc/agent/webhook.py |
deliver_webhook() function |