Supported events
Each endpoint can subscribe to one or more event types:task-run.started— Emitted when a run transitions fromPENDINGtoRUNNING.task-run.completed— Sent after successful completion; payload mirrors the run resource.task-run.failed— Delivered when a run exits withFAILEDstatus and includes error context.task-run.cancelled— Triggered after a run is cancelled (manual API call or dashboard action).task-run.log— Streams batches of new log entries while the run executes.
Payloads
task-run.* events reuse the run resource. A typical
task-run.completed payload looks like this:
task-run.log carries the same structure as GET /public/v1/task-runs/{runId}/logs:
Request headers
Every webhook delivery includes the following headers:x-komos-event— Event type string (for exampletask-run.completed).x-komos-signature— Verification metadata formatted ast=<ISO timestamp>,v1=<hex signature>.x-komos-endpoint-id— UUID of the endpoint that received the event.x-komos-run-id(optional) — Present for run-related events.x-komos-task-id(optional) — Present when the endpoint is scoped to a single task.content-type: application/json
Signature verification
Webhook signatures help confirm Komos sent the request. Use the signing secret shown when you create an endpoint (formatwh_<prefix>_<secret>). The verification process matches the server-side logic:
- Split the secret on the first underscore. The portion after the underscore is the raw secret.
- Derive the signing key with
HMAC-SHA256(key=WEBHOOK_SIGNING_PEPPER, message=raw_secret). Komos uses the default pepperkomos-webhook-pepperunless your organization overrides it. - Parse
x-komos-signatureinto the timestamp (t) and signature (v1). - Build the payload string
<timestamp>.<raw_request_body>. - Compute
HMAC-SHA256(key=derived_signing_key, message=payload_string)and compare the hex digest withv1using a constant-time comparison.
Python example
Retry policy
- Komos retries failed deliveries up to 6 times.
- The initial retry waits 60 seconds, doubling each attempt with up to ±30 seconds of jitter.
- Backoff is capped at 30 minutes. After the final attempt the event is marked
dead_letteredand surfaces in the dashboard along with the last error.