Webhook Retry Strategy
A webhook retry strategy defines the rules for re-attempting failed webhook deliveries — including which HTTP response codes trigger a retry, how long to wait between attempts using exponential backoff, and what happens when all retry attempts are exhausted.
A webhook retry strategy defines the rules for re-attempting failed webhook deliveries — including which HTTP response codes trigger a retry, how long to wait between attempts using exponential backoff, and what happens when all retry attempts are exhausted.
What the diagram shows
This flowchart details the decision tree that a webhook dispatcher executes after receiving a non-successful delivery response:
1. Classify response: not all failures should be retried. A 200-299 means success. 4xx responses (except 408 Request Timeout and 429 Too Many Requests) indicate a permanent error — a misconfigured endpoint or unauthorized payload — where retrying won't help. 5xx responses and timeouts are transient and should be retried. 2. Increment attempt counter: the dispatcher increments the delivery attempt count for this event. 3. Check max attempts: most platforms attempt delivery 3-10 times over hours or days. GitHub webhooks retry for 3 days; Stripe retries for 3 days with up to 72 attempts. 4. Compute backoff: the wait time follows exponential backoff — min(base * 2^attempt, max_delay) — with optional jitter to spread load. 5. Schedule retry: the retry is scheduled as a delayed job in the queue. 6. Dead letter: exhausted retries move the event to a dead-letter store where it can be inspected, manually replayed, or trigger an alert to the consumer's account.
Why this matters
Consumers go down for maintenance, deployments, or unexpected failures. A robust retry strategy means events aren't permanently lost during those windows — they queue up and drain once the endpoint recovers. The exponential backoff prevents the dispatcher from hammering an already-overwhelmed consumer endpoint.
For the full delivery flow that precedes retries, see Webhook Delivery Flow. The retry algorithm mirrors Request Retry Logic used by HTTP clients. For dead-letter queue handling, see Messaging Dead Letter Queue.