Open to employment
Failures & reliability4 min read

Webhook duplicates: stop one event becoming two business actions

A webhook is a notification that something happened in another system. It is tempting to treat every arrival as a new business event. That assumption can produce two CRM records, two emails or two fulfilment tasks when the same event arrives again. A reliable design distinguishes delivery of a message from permission to repeat its business effect.

Failures & reliabilityMK.
Two deliveries. One decision.
A working model of the topic. Numerical examples in the article are labelled planning assumptions.
The idea behind it

If an operator can replay events, the replay path needs the same protection as the original path. A button labelled “retry” is not an exemption from duplicate handling. One event may travel several times; the business should still see the intended action only as often as its rules allow.

01 /

Check the sender’s delivery contract

Different providers have different rules for retries, event identifiers and ordering. Read the documentation for the actual sender rather than assuming all webhooks behave alike. Stripe, for example, documents duplicate delivery and does not guarantee event ordering in its webhook guide. Those details belong in the receiving workflow’s design.

Write down the event types you need and ignore unrelated types deliberately. A broad subscription can feed actions the workflow was never designed to handle. Also distinguish the notification’s event identifier from the customer or order identifier inside it. One customer can legitimately produce several events, so deduplicating every message by customer ID alone can lose real work.

02 /

Authenticate before trusting the payload

A public endpoint should not accept an arbitrary incoming message as proof of an event. Use the sender’s supported verification mechanism and protect the associated secret. Do not put secret values into visible URLs or publish them with a workflow export. Check the exact verification requirements; modifying the body before verification can matter for schemes that sign the original bytes.

GitHub’s webhook guidance discusses secrets, HTTPS and delivery identifiers for its own service. That is a useful concrete reference, not a universal signature recipe. Verification and deduplication solve different problems: a genuine message can still be delivered twice.

A delivery is not a second permission
ArrivalReceipt stateBusiness action
Event E-42, first deliveryAccepted durablyProcess once
Event E-42, repeatedAlready completedDo not repeat completed action
Event E-42, uncertain resultPending reconciliationCheck destination first
Event E-43, new eventSeparate identityEvaluate its own rules
03 /

Record receipt before acknowledging completion

Separate “we have durably accepted this event” from “the business action is finished”. For longer work, a durable queue or receipt store can let the endpoint acknowledge accepted work while processing continues separately. Do not acknowledge success before the event is safely retained if losing it would matter.

The retained record needs an identity and a state, such as received, processing, completed or needs review. A temporary in-memory list is not durable across a restart. Equally, a stored flag saying “seen” is not enough if a failure can occur between recording that flag and performing the action. You need to know whether work is complete, pending or uncertain.

04 /

Make the duplicate check safe under concurrency

A simple sequence of “search for event, then insert event” can race. Two workers may both find nothing and both proceed. Use storage behaviour that enforces the intended uniqueness atomically, and design what the losing worker should do. The correct identifier and retention period depend on the provider and the business operation.

There is still a boundary between your receipt store and an external action. Recording completion locally does not make a remote write part of the same transaction. Use the destination’s idempotency feature where available, or a reconciliation process where the result is uncertain. See n8n errors and retries for why a timeout must not automatically trigger another create request.

05 /

Expect events to arrive in an inconvenient order

A delayed “created” event might arrive after an “updated” event. Blindly applying arrival order could replace newer information with older data. Check whether the provider supplies versions or sequence information, or whether the current object should be retrieved from the source. A timestamp alone may not resolve all ties and timing differences.

For a fictional order workflow, the test is not simply that both messages were accepted. The resulting order must have the intended current state and must not trigger a second shipment. Keep event history separate from current business state so a late notification can be inspected without automatically rolling the object backward.

06 /

Test redelivery as an ordinary scenario

Deliver the same test event twice, then twice concurrently. Interrupt processing after receipt and after the external action. Restart the worker and inspect the final state. Also deliver a later event before an earlier one. Record which outcomes your test destination proves and which need verification against the real provider.

If an operator can replay events, the replay path needs the same protection as the original path. A button labelled “retry” is not an exemption from duplicate handling. One event may travel several times; the business should still see the intended action only as often as its rules allow.

Sources & further reading

Official references, checked on 12 October 2026.

  1. Stripe: webhook delivery behaviour ↗
  2. GitHub: webhook best practices ↗
Milad Khazem

Written by Milad Khazem

I build automations, websites, apps and digital systems. Here I explain decisions from working on my projects, including the limits that a demo cannot remove.

More about my background ↗
← Back to the blog