Guides

Webhook retries and backoff: a practical guide

When to retry a failed webhook, how long to wait between attempts, which status codes to give up on, and how to handle a delivery that arrives twice.

Updated

Get a free webhook URLNo credit card · Free plan included

A webhook is a promise that one system will tell another when something happens. Networks drop requests, receivers deploy, databases lock and certificates expire, so the promise only holds if a failed delivery is tried again. This guide covers how to retry well, from either side, and then how Hookie does it.

Why retries need a schedule

Retrying straight away rarely helps. If a receiver is down for a 30-second deploy, five retries in the first second all fail, and the event is lost even though the receiver came back. Retrying forever at a fixed short interval has the opposite problem: when a receiver recovers, every queued delivery hits it at once.

A good schedule has three parts:

  • Growing waits. Start short, so a brief blip costs seconds, and grow, so a long outage is still covered. That is exponential backoff, usually capped.
  • Jitter. Randomise each wait a little, so deliveries that failed together do not come back together.
  • A final window. Decide how long an event is worth trying, then stop and record it as failed somewhere a person can see and replay it.

Which failures to retry

Not every failure means “try again later”.

ResponseRetry?Why
Timeout, connection refused, DNS failureYesThe receiver did not get the request, or did not answer it.
5xxYesThe receiver had a problem of its own.
429 Too Many Requests, 503Yes, after any Retry-AfterThe receiver is asking for less traffic. Honour the header.
408, 409, 425Yes“Not now” rather than “no”.
404UsuallyA route can vanish for a moment during a deploy.
Other 4xx (400, 401, 403, 410, 422)NoThe receiver is saying the request itself is wrong. It will say so again.

Receivers: make a second delivery harmless

Any system that retries delivers at least once. Sooner or later the receiver answers slowly, the sender times out and retries, and the same event arrives twice. A receiver should:

  1. Answer fast. Acknowledge with a 2xx as soon as the request is verified and stored, and do slow work afterwards. A slow answer looks like a failure and earns a retry.
  2. Deduplicate on the event’s ID. Keep the IDs of events you have handled, and skip one you have seen. Use the event’s ID, not the delivery attempt’s.
  3. Not rely on order. Retries reorder events. If order matters, compare a timestamp or version in the payload before applying a change.

How Hookie retries deliveries

Hookie receives a webhook, stores it whole, and then delivers it to your destinations. Each delivery to your service follows this schedule:

  • 8 attempts over about 27 hours: the first try, then waits of 5 seconds, 5 minutes, 30 minutes, 2 hours, 5 hours, 10 hours and 10 hours.
  • ±20% random jitter on every wait, so a recovering receiver is not hit by every delivery at once.
  • Retry-After is a floor: when your service answers 429 or 503 with Retry-After, Hookie waits at least that long.
  • Retried: network errors, 5xx (except 508, Hookie’s own loop guard), 404, 408, 409, 425 and 429. Any other 4xx stops at once, because sending the same refused request again changes nothing.
  • After the last attempt the delivery is marked dead in the delivery log, with the reason, and you can replay it from the console, the API, the CLI or MCP.

On Pro and above, a destination can set its own policy instead: linear or exponential, with your own number of attempts (up to 50) and window (up to 7 days).

Verify the raw request body, then deduplicate on its id field. The default envelope carries the same record ID across retries and manual replays. Include {{id}} in a custom template if the receiver needs that guarantee. The Hookie-Event-Id and Idempotency-Key headers are unsigned. If you verify the Standard Webhooks signature, its signed webhook-id identifies retries of one delivery. A manual replay gets a new delivery ID. Signature verification guide

Checklist

  • Sender: growing waits with jitter, a final window, and a place to see and replay what failed.
  • Sender: retry timeouts, 5xx, 429 and “not now” codes; stop on other 4xx.
  • Receiver: verify, store and answer 2xx quickly; do slow work afterwards.
  • Receiver: deduplicate on the event ID and do not rely on order.