Skip to content
Independent guides for support teamsHow we work
Support SystemsJournal

The software.
The decisions.
The people behind support.

Integrations and Data

Designing Webhook Receivers That Tolerate Duplicate Support Events

Design a durable event inbox, atomic worker claims, and recoverable side effects so repeated support webhooks do not silently duplicate work.

Blank cards and a metal clip beside a tablet
AI-generated editorial illustration.

A webhook can tell a support integration that something changed. It does not by itself prove that the change was processed once, in order, or completely. A receiver can create a CRM case and then crash before acknowledging the delivery. The provider may retry, leaving a second worker facing an operation that partly succeeded.

Design for that uncertainty before connecting customer-facing notifications or record updates. The practical deliverable is an event-processing worksheet: how an event is authenticated and identified, where it is durably accepted, which worker owns it, how each side effect is recorded, and how an operator recovers failed or ambiguous work.

Read the actual delivery contract

Providers differ in timeout, retry, replay and ordering behavior. Do not assume that a successful subscription guarantees every event will arrive. Zendesk, for example, documents possible duplicate deliveries and circumstances where events are not delivered. Use the provider’s current documentation when selecting response codes and recovery behavior. See Zendesk’s webhook monitoring and retry documentation.

Identify the distinction between an event ID and a delivery-attempt ID. Several attempts may concern one event; a transport identifier that changes on each attempt will not recognize that repetition. If the provider supplies no stable event identifier, document what combination or reconciliation method is actually supported. A ticket ID alone is insufficient because one ticket can have many legitimate changes.

Accept an event durably before acknowledging it

Authenticate the request according to the provider’s protocol before trusting its tenant, event ID or body. Where the signature covers the raw request body, preserve those bytes for verification. Apply the documented replay checks and payload limits. An event identifier is a lookup key, not a credential.

For a proposed durable-inbox design, store the verified event with its provider, source account, stable event key, schema version, receipt time and processing state. Keep only the payload needed for the work and protect it as customer data. A database uniqueness rule or equivalent atomic operation should decide whether this event has already been accepted.

Return the provider’s documented success response only after durable acceptance, or after establishing that an authenticated duplicate is already durably accepted. Background workers can then perform the slower work. If acceptance storage is unavailable, do not acknowledge and rely on an unprotected local text file. Follow the provider’s supported failure response and alert on the outage; a later reconciliation may still be necessary if retries expire.

Make the claim atomic, not a check followed by a write

Two workers can both read “not processed” before either writes a result. Checking for an ID and inserting it only after external work does not prevent this race. In the proposed design, a worker atomically claims a pending inbox record, with a documented lease or recovery mechanism for a worker that dies.

A uniqueness rule protects acceptance, while worker coordination protects active processing. Neither automatically makes an external email or CRM write atomic with the local database. PostgreSQL’s INSERT documentation describes database-level conflict handling; its scope is the database operation, not an external API call.

State Meaning Recovery question
Accepted Verified event is durably stored Is it waiting longer than the service target?
Processing A worker holds the processing claim Has the claim expired, and can another worker safely resume?
Retryable failure A recorded step needs another attempt Was the external result definitely rejected or is it uncertain?
Needs review Safe automatic continuation is unavailable Who can reconcile the target before deciding whether to retry?
Completed Required steps and outcomes are recorded Does reconciliation agree with the intended target state?

Give each side effect its own recovery rule

For record creation, use a target-supported idempotency key or an enforced unique external key where available. A search-before-create check alone can race. Define whether the business operation is “one case per support ticket” or “one case per event”; those are different keys. Do not merge ambiguous duplicates blindly, especially across customer accounts.

For a notification, keep a dispatch record tied to the intended business action and recipient scope. If the sending service supports idempotent requests, use that feature within its documented limits. If the service accepted a message but the connection failed before returning the result, the local system may not know whether it was sent. Mark the outcome uncertain and reconcile where possible. A log written after sending cannot promise exactly one message.

For an update, compare the documented source revision or fetch current authoritative state when appropriate. A different value is not necessarily a newer value. Arrival time and wall-clock timestamps alone may not establish order. For analytics, preserve the intended event identity and distinguish a duplicate delivery from two distinct business events; do not deduplicate merely because two rows look similar.

A failure timeline to test

Consider a fictional receiver that creates one CRM case per scoped help-desk ticket and then sends an internal notification. At 10:02:00 it verifies event E-17 and commits it to its durable inbox. At 10:02:01 it acknowledges acceptance. A background worker claims E-17 and creates the CRM case using a target-supported idempotency key.

At 10:02:04 the worker crashes after the CRM accepted the creation but before the local result was recorded. A second delivery of E-17 finds the existing inbox record and is acknowledged without starting another independent workflow. Once the first worker’s claim expires, recovery resumes the recorded step using the same supported idempotency key and obtains the existing CRM result.

The notification step then runs according to its own dispatch rule. This example assumes the CRM supports the key and retains it for the recovery interval. If it does not, the recovery process must compare the target state and may require manual review. The example illustrates a design to test; it does not establish a universal exactly-once guarantee.

Keep ordering, retention and reconciliation separate

Deduplication asks whether the same event was already accepted. Ordering asks whether applying an event would replace newer state. Retention asks how long the processing evidence remains available. Set each rule explicitly. Stripe’s webhook guidance discusses duplicate handling, asynchronous processing and event ordering; use the corresponding rules for your actual provider.

Choose processing-record retention from the documented retry and replay windows, operator recovery needs, downstream idempotency-key lifetime and data-retention policy. A universal “three times the retry window” rule is not sufficient. Old manual replays can outlive automatic retries. After evidence expires, a replay may require reconciliation rather than normal automatic processing.

Do not reprocess an already completed event merely because a repeated delivery contains a different payload. Investigate the provider’s documented event semantics and record the discrepancy. If a new source revision requires work, process it under the appropriate update rule without repeating completed business actions.

Acceptance tests and operational signals

Test sequential duplicates, concurrent duplicates, two distinct events for the same ticket, out-of-order updates, invalid authentication and a storage outage before acceptance. Then interrupt the worker before and after each external side effect. Check the resulting target records and notifications, not just the HTTP responses.

A partial-failure test should produce a recorded error and a recoverable state; “no errors logged” would hide the incident. Confirm that expired claims can be recovered, that one failed step does not repeat completed steps unnecessarily, and that uncertain external outcomes reach an owner instead of an endless retry loop.

Monitor oldest pending work, retry exhaustion, uncertain outcomes, authentication failures and reconciliation mismatches. Keep a runbook with the evidence needed to resume, hold or reconcile an event. Duplicate tolerance is useful only when ordinary operators can understand what happened and recover without creating another customer-visible error.

Have a question or a correction?

Contact the editorial team