workflows

Duplicate webhooks: stop retries from repeating the business action

A practical decision model for separating webhook delivery, provider events and the business action before a retry causes duplicate work.

A webhook retry is not a second customer order. Yet a workflow that treats every delivery as new work may send two confirmations, create two records or repeat an external action. This matters whether a US or Canadian team uses Stripe or a UK team connects an automation platform: check the exact contract of each provider before applying the model.

The short answer

Deduplicate the business effect, not just the HTTP request. Verify the sender, derive a stable key and durably store or enqueue the delivery; then acknowledge receipt promptly under the provider’s contract. Async processing checks the object’s state and applies the allowed effect. A repeat must find a recoverable state, not merely a “seen” flag. A different event for the same object needs evaluation rather than automatic dismissal.

Stripe documents duplicate deliveries, retries and events arriving out of order. Make describes at-least-once delivery for event subscriptions. n8n notes that an execution ID changes with each run, so it cannot recognize a retriggered webhook by itself. None of these facts promises exactly-once effects across every downstream service.

Match the key to the action

Candidate key What it identifies Useful for Watch out for
Delivery or run ID One processing attempt Auditing that attempt A retry may have a new ID
Provider event ID One emitted event Rejecting a redelivery of that event Different events can reference one object
Object ID + event type A particular object transition Detecting repeated transition notices State and provider semantics still matter
Order/payment ID + intended action The business effect Preventing two confirmations or two fulfilments Define precisely when the action is considered complete

This is a Pulse decision model. For a payment confirmation, ask “has this action already been applied to this payment?” and keep evidence for that answer. Store only the personal data needed to operate and audit the process.

A safe processing sequence

  1. Validate signature, sender and payload using the provider’s current instructions. Do not act on an untrusted notification.
  2. Extract the event ID and object ID. If the intended effect has no stable identifier, route it to review.
  3. Durably store or enqueue the delivery and promptly acknowledge receipt under the provider’s protocol. That response means delivery accepted, not business effect completed; do not wait for a slow external action to respond.
  4. In separate processing, atomically claim the business key as received/claimed. A separate “look up, then insert” check can race. Fetch the object’s current state from the authoritative system.
  5. Move to processing and apply only the permitted transition. Pass an idempotency key downstream when supported; otherwise keep a destination receipt or use an inbox/outbox pattern and reconcile uncertain outcomes before retrying.
  6. Mark completed only with evidence of the effect. Record failed or uncertain when appropriate, with source ID and time. An abandoned claim needs queue recovery, a lease or timeout; claimed alone never proves completion.

Plan for both failure directions. If the worker crashes after claiming the key before the effect, recovery must resume the pending work. If an email or fulfilment action succeeded but its response was lost, mark uncertain and inspect the destination or receipt before retrying. Only completed proves the effect was confirmed.

Six cases to prove in your own staging environment

Hypothetical case Expected decision
The same event ID arrives twice The second delivery does not repeat the effect
Two events reference the same paid order The business rule checks whether fulfilment already happened
An older event arrives after the current status The workflow does not roll back the current state
The effect succeeded but the response was lost Reconcile the destination before another attempt
Key claimed, worker crashed before the effect Recover the pending state and execute the action once
No reliable ID is present Pause for review; do not infer identity from amount and time

These are proposed test cases, not results from a Pulse deployment. The release condition is a traceable decision for each case in your own controlled environment.

Use the automation failure contingency plan for the wider recovery path. After a payment event, reconcile sales, payouts and bank deposits separately: preventing duplicate notifications does not prove cash has settled.

Sources and limits

The Stripe webhook documentation supports the duplicate and ordering caveats. The n8n idempotency guide explains why run IDs do not represent repeated business requests. Make’s event subscription documentation describes delivery behavior. The key matrix and sequence are our editorial synthesis, not a claim of a tested integration or a universal exactly-once guarantee.

Sources