Skip to content
A2Z Skills
Topics
Search
ExplainerAutomation

Why webhooks arrive twice: retries and duplicate events

Devchandra Shrestha

4 min read

Short answer

A webhook arrives twice when the sender cannot confirm the first delivery succeeded, or when somebody asks for a resend, and retry rules differ by provider. Stopping a duplicate effect means identifying each event by its ID and recording that it was processed.

Researched explainer. Supporting documentation and research are linked in the article.

Two matching envelopes following delivery and retry paths into a tray that produces one record.
Editorial illustration

Two workflow executions can begin with the same notification. That can happen even when the sender generated only one event: the first delivery may have reached your system without its acknowledgement reaching the sender.

A second execution also needs evidence before it can be called a duplicate. Related events about the same order may describe different changes. This article covers the delivery and processing concepts, with provider-specific examples linked to their documentation. More explanations are in Automation.

A delivery attempt and a completed action are different records

Consider a hypothetical notification that creates a support ticket. The receiver creates the ticket, then its connection closes before the sender receives a response. A later delivery of the same notification reaches the receiver again. Creating another ticket would repeat an action that already succeeded.

The sender’s delivery history and the destination’s ticket history describe different parts of that sequence. A failed delivery entry alone cannot establish whether the ticket was created. A workflow execution count also cannot establish how many distinct events occurred.

This distinction is relevant when investigating automations that report success without the expected result. In one case work is repeated; in the other it may be missing. Both require evidence from the destination.

Retry behaviour depends on the sender

Stripe’s webhook documentation describes automatic retries after unsuccessful delivery. It also says a manual resend does not cancel an existing automatic retry sequence, even if the resend receives a successful response.

GitHub’s failed-delivery documentation says GitHub does not automatically redeliver failures. Redelivery can instead be requested manually or performed by code.

Sender Automatic retries documented? Consequence when reading logs
Stripe Yes A later attempt may belong to the same event, including after a manual resend
GitHub No Redelivery requires another mechanism; absence of a retry does not prove success

A retry policy copied from another provider can therefore produce the wrong explanation for the same symptom. The sender, event identity and delivery history are part of the diagnosis.

Event identity and business identity serve different purposes

Stripe documents tracking processed event IDs to recognise repeated deliveries. It also notes that separate Event objects can sometimes represent duplicates, for which the object ID and event type are relevant. Those are provider-specific rules, not a universal instruction to discard every event about the same object.

For a hypothetical order, an update and a cancellation can share an order ID while representing different work. A rule that discards everything after the first appearance of that order could lose the cancellation.

GitHub’s webhook best practices specify X-GitHub-Delivery as the delivery identifier and explain that a requested redelivery keeps the original value. The identifier belongs to the provider’s contract; hashing an entire payload is a different design with different assumptions.

Concurrent attempts complicate duplicate handling

Imagine two identical deliveries arriving together. Each receiver checks a list, finds no completed record and starts work. A later insertion into the list cannot undo the two actions already started.

AWS documents this problem in its Powertools idempotency design. It distinguishes work in progress from completed work and uses a persistence layer to prevent concurrent execution of the same operation. Its documentation also covers expiry and failure states.

The crash points matter too. Recording completion before creating the ticket can lose the ticket if processing stops between those actions. Creating the ticket first can allow repetition if processing stops before completion is recorded. The correct boundary depends on the storage and destination API; a simple “already seen” check does not by itself resolve both cases.

Fast acknowledgement still needs durable processing

GitHub recommends timely responses and describes queueing work for background processing. A receiver that acknowledges before finishing needs a durable record of the work it accepted. Otherwise a restart can leave the sender with a success response and the destination with nothing.

For n8n, a separate question is whether the endpoint is registered and listening. That is covered by the tested n8n webhook diagnosis. An endpoint registration problem and duplicate downstream actions should not be combined into one presumed cause.

Verification and idempotency are separate controls

GitHub recommends validating deliveries with a webhook secret. Authentication helps establish that a request came from the expected sender; a valid request can still be delivered again.

An outgoing API’s retry protection has its own scope. For example, Stripe’s idempotent-request documentation describes keys that protect supported outgoing API requests against repeated operations. That does not automatically deduplicate every action in a webhook receiver, such as creating a ticket in another service. A tested implementation would need evidence for the whole path from incoming event to destination result.

ShareHacker News

Did this fix it?

We re-test the guides that stop working. Telling us is the fastest way to get one fixed.

Questions people also ask

Do all webhook providers retry failed deliveries automatically?
No. Stripe documents automatic retries, while GitHub says failed webhook deliveries are not automatically redelivered. The sender's delivery policy determines what happens.
Does replying successfully prove the workflow completed?
A successful response acknowledges delivery. If processing continues afterwards, the receiver still needs durable work storage, failure handling and evidence that the destination action completed.
Will a webhook secret prevent duplicate processing?
Signature validation helps establish the sender and payload integrity. A legitimate delivery can still be resent. Duplicate handling and sender verification address separate problems.

Devchandra ShresthaEditor, A2Z Skills

I run A2Z Skills and edit everything that goes out. My own testing is desktop and web: Windows and macOS repair, domains, DNS and hosting. If a step in one of our guides does not work on your machine, I am the one who reads the email and fixes the post.

Join the guide notification list

Email delivery is not active yet. No sharing or selling your address.