Replay a failed event without repeating the business action
The destination created the record, but the response never arrived. This worked example follows that uncertain state through receipt, processing and replay, with a recovery record an operator can use.
Worked example. This is a proposed solution for a fictional operating scenario, not a client engagement. No measured results are claimed.

- The problem
- A failed workflow is rerun from the start and duplicates a record that the destination already created.
- The approach
- Persist incoming events, track each business effect and reuse stable destination references during recovery.
- Intended outcome
- The intended benefit is recoverable processing with fewer duplicate effects. Exactly-once delivery and zero downtime are not promised.
Example system roles Webhook provider · durable event store · worker queue · destination API
Received is not processed
Assume a payment provider sends events that create a downstream finance task and update a CRM record. A synchronous handler performs every action before returning. If one step fails or the response is lost, the provider may retry while the original action already exists.
Separate receipt from processing. Verify the provider's signature against the required request representation, validate the event and persist it durably before acknowledging successful receipt. A queue acknowledgment without durable storage can lose the event.
Stripe explicitly documents duplicate delivery and no guaranteed event order. Those are useful concrete constraints for this worked example; verify each other provider's own contract.
Two kinds of identity protect two different things
Use provider account plus event ID to deduplicate delivery. Claim that key atomically, for example with a database uniqueness constraint, rather than checking and inserting in separate steps that can race.
Also identify the business effect. Different events can request the same destination action. A task might use invoice ID plus action type; an invoice draft might use an approved milestone reference. Persist that effect key and the destination ID.
An event receipt marked complete too early can hide a failed effect. Track pending, processing, completed and review-needed states with attempt history. Only mark the effect complete after its destination result is known.
Proposed workflow
Receipt, effect and replay are separate records
Verify and persist
Atomically claim provider account plus event ID.
ReceiverProcess effect
Use a stable business-action key.
WorkerConfirm destination
Store result or investigate unknown outcome.
Destination adapterRecover deliberately
Repair cause and replay a bounded selection.
Operator
Unknown create outcomes require destination lookup. Permanent errors enter review. Replays reuse the original event and business-effect identities.
The hardest failure is an unknown outcome
A timeout after a create request doesn't tell you whether the destination created the record. First look up the external reference or use the destination's supported idempotency mechanism. If neither gives a reliable answer, route to operator review.
Retry transient failures with bounded backoff and a rate limit appropriate to the destination. Validation failures need corrected data. Expired credentials need an operator. Treating all errors as retryable turns a recoverable fault into an endless queue.
Events that arrive out of order should not blindly replace current state with an older snapshot. Retrieve current source state where appropriate or apply a version-aware transition rule.
Replay is an operation with a scope
After fixing the cause, select a bounded set of failed events. Record who authorized replay, why, the selection criteria and the expected destination effects. Run through the same identity checks as normal delivery.
Start with a small sample and inspect the results. Limit concurrency so recovery doesn't overload the system that just recovered. Repeated failures return to a review queue with attempt history rather than disappearing into another automatic loop.
Retain only the event data needed for diagnosis and replay under the organization's retention policy. Logs should carry identifiers and error categories without dumping credentials or unnecessary personal data.
Rehearse recovery before launch
The acceptance test is more than a successful event. Deliver the same event twice, send two distinct events for the same effect, lose the destination response and process a stale event after a newer one.
Operators need to know how to inspect the queue, pause a worker and verify destination state. If the integration platform already provides these controls, use them and document their limits.
Keep this part
Failure rehearsal matrix
Before retrying, find out which destination records already exist.
| Injected failure | Expected behavior | Evidence |
|---|---|---|
| Same event delivered twice | One receipt claim and one effect | Event key and effect key |
| Distinct events request same action | Reuse existing business result | Destination reference |
| Response lost after create | Lookup before another create | Recovered destination ID |
| Older event arrives last | Do not regress current state | Source version or fetched state |
| Credentials expire | Pause or hold for repair | Owned error record |
| Replay still fails | Return to bounded review queue | Attempt history and reason |
Use the example to agree the rules, then fill in the blank sheet with your own records and owners. Downloads are free; no email required.
Evidence & limits
How to evaluate the proposal
For a defined event cohort, report pending age, failed effects, duplicate effects and successful recoveries. Record the failure modes exercised. A local rehearsal doesn't establish a production availability percentage.
- Destination idempotency, lookup support and provider retention determine recovery options.
- No architecture can guarantee exactly-once effects across arbitrary APIs without supporting destination controls.
Sources & implementation context
- Stripe: webhook delivery and duplicate events
Primary evidence for repeat delivery, event ordering and asynchronous handling constraints.
The design decisions and worksheets are original worked-example material. Vendor documentation supports specific platform behavior, not a claim that this implementation has been delivered.
How this page was prepared
AI assisted the research, drafting and conceptual artwork, helping compare source material and turn the workflow into a reusable worksheet. The scenario is fictional and the design is a proposal. The stated sources and limitations define the evidence available. No independent expert review or client result is implied.
About the team commissioning this collectionContinue with the useful detail
Where this connects.
Your next step
What happens when your workflow fails halfway through?
Bring one failed execution and the records it touched. We can define the identity, recovery and operator controls it needs.

