AscendXIASCEND X INTELLIGENCELet’s talk

Engineering / FIELD GUIDE

A webhook endpoint needs a replay strategy

Webhook integrations receive events under conditions the application does not control. Duplicate delivery, delays and failures should be part of the design from the start.

The decision that matters

Authenticate the event using the provider’s documented mechanism, validate the expected payload and persist the event identifier before performing important work. Make processing idempotent and avoid assuming arrival order is the business order. Return a timely response after durable acceptance, then process longer work separately when appropriate. Keep failed events visible and define how an operator can safely replay them.

A practical scenario

A subscription event may arrive after a more recent state change. Blindly applying every payload in arrival order can move an account backward. Depending on the provider, the processor may need to compare event timing or fetch current authoritative state. The correct strategy depends on the event contract and should be tested with delayed and repeated fixtures.

Before you ship

  • Follow the provider’s signature verification requirements.
  • Deduplicate events and bound processing time.
  • Test delayed, duplicate and replayed events explicitly.

A useful next step

Create a small event ledger with status and correlation details. Use it to explain what happened to a specific event without exposing secrets. A replay button should rerun a known, bounded operation rather than execute an arbitrary payload entered by an operator.

Primary reference & further reading

This guide combines general engineering recommendations with an illustrative scenario. Provider behavior can change; check current documentation before applying it. Read our editorial approach.