What happens when a webhook arrives twice?
The same business action should not run twice just because a delivery is retried. A webhook is an HTTP request triggered by a subscribed event. Treat the request as an integration boundary with its own validation, acknowledgement, and processing states. GitHub describes the delivery flow.
GitHub recommends a secret, HTTPS, checking event type and action, and responding within ten seconds. Its delivery identifier stays the same for a redelivery, which is useful when detecting repeated deliveries. See GitHub's operational guidance.
A processing pattern to consider
Our recommended design begins by validating the signature over the received payload using the provider's documented method. Then record the provider and delivery identifier in durable storage. Enforce uniqueness for that pair, rather than relying on an in-memory check that disappears when the process restarts.
Acknowledge only after the work has been safely recorded or queued. A background worker can then perform the slower task and update its processing state.
Delivery identity is only half the problem
A customer action may generate several distinct events. A unique delivery identifier prevents replaying one delivery, but it does not automatically prevent two different events from initiating the same business operation.
Define a separate business identity where needed: for example, the provider's transaction identifier plus the operation being applied. Review how that identity behaves during corrections, cancellations, and partial completion.
Test failure paths deliberately
- Deliver the same event twice and confirm one intended business effect.
- Stop the worker after it records progress, then retry and inspect the outcome.
- Send an invalid signature and an unsupported event type.
- Simulate a downstream timeout after the remote operation may already have succeeded.
Keep delivery history and processing errors available to the support team. A green acknowledgement is evidence of receipt; it is not proof that the downstream task finished.
Source review: 15 November 2026. This is an editorial guide based on the linked documentation, not a report of client results.