Skip to main content

Worked exampleSystems operations

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.

A sculptural loop of ivory dominoes on a charcoal stage with one fallen piece caught in a brass cradle and a yellow bridge leading back into the line. Conceptual editorial illustration.
Conceptual editorial illustration. The workflow below describes a proposed solution.
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

  1. Verify and persist

    Atomically claim provider account plus event ID.

    Receiver
  2. Process effect

    Use a stable business-action key.

    Worker
  3. Confirm destination

    Store result or investigate unknown outcome.

    Destination adapter
  4. Recover deliberately

    Repair cause and replay a bounded selection.

    Operator
Exception & recovery

Unknown create outcomes require destination lookup. Permanent errors enter review. Replays reuse the original event and business-effect identities.

Proposed recovery architecture. A durable receipt protects the event; a stable effect key protects the destination action. Download the diagram (SVG)

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.

Example rules and teaching inputs. Adapt them to your process.
Injected failureExpected behaviorEvidence
Same event delivered twiceOne receipt claim and one effectEvent key and effect key
Distinct events request same actionReuse existing business resultDestination reference
Response lost after createLookup before another createRecovered destination ID
Older event arrives lastDo not regress current stateSource version or fetched state
Credentials expirePause or hold for repairOwned error record
Replay still failsReturn to bounded review queueAttempt 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

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 collection

Continue 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.