POST requests to your endpoint. If you haven’t set one up yet, start with Destinations & deliveries.
Once events are flowing, your endpoint needs to handle them reliably. Network issues, duplicate deliveries, and out-of-order events are normal in any webhook-based system.
Respond quickly
Return a2xx status code within 5 seconds. Deck treats anything else as a failure and schedules a retry.
Do your processing asynchronously. Accept the event, persist it, and return immediately.
Verify signatures
Verify every delivery before processing it. Cloud destinations like SQS and Pub/Sub authenticate through their native IAM credentials, but webhook destinations require signature verification. Deck signs every webhook delivery using the Standard Webhooks specification. Every delivery includeswebhook-id, webhook-timestamp, and webhook-signature headers. Use the official Standard Webhooks SDK — it handles signature computation, timestamp tolerance, and constant-time comparison.
Handle duplicates
Deck guarantees at-least-once delivery. The same event may arrive more than once, especially after retries. Use the eventid as a deduplication key and design your processing to be idempotent — use upserts instead of inserts, and check state before mutating.
Handle out-of-order delivery
Events may not arrive in order. Atask_run.completed event could arrive before task_run.running if the first delivery was retried. Use the event’s created_at timestamp to determine the true sequence — compare it against your last-known state and skip anything older.
Build retry-safe endpoints
Design your endpoint to handle the same payload multiple times safely:- Return
200for events you’ve already processed. Never return an error for duplicates. - Don’t assume sequential delivery. Your endpoint may receive events from different task runs interleaved.
- Handle missing context gracefully. If an event references a resource you haven’t seen yet, fetch it from the API or queue the event for later.
Monitor delivery health
Track delivery status through the API to catch integration issues early.Check for failed deliveries
Replay failed deliveries
If a delivery failed because of a bug in your handler, fix the bug first, then replay:Endpoint availability
Deck retries failed deliveries up to 3 times with exponential backoff. After all retries are exhausted, the destination is set toinactive.
To recover, fix the issue, set the destination status back to active via the API or Dashboard, then replay any failed deliveries.