Integrations

A webhook arrived twice: preventing duplicate business actions

Two notifications may describe the same event, or a sender may retry after not receiving a clear response.

2 min readLast updated November 4, 2026
A developer and colleague reviewing a connection between business systems

Two notifications may describe the same event, or a sender may retry after not receiving a clear response. If every arrival creates a customer record or follow-up task, duplicate sales data can result from a single original message.

Define what counts as the same event

Do not identify an event by message text alone. Two customers can send “agreed” within the same minute, and one customer can repeat it deliberately. The integration needs a suitable event reference scoped to its source and organisation, based on the actual contract being received.

Review the documented and observed payload before selecting that reference. Avoid inventing a field name or assuming that delivery updates and conversation events use identical structures. Where no adequate identifier exists, document the matching method's limitations rather than promising guaranteed duplicate prevention.

Protect the action, not just the arrival log

Two simultaneous requests can both find no existing event and then perform the action. Persistent coordination must prevent that race when recording processing, with an explicit decision about transactions and external effects. An in-memory list is insufficient across multiple workers or servers.

If execution fails after work is marked as started, a later retry should not be ignored permanently. Distinguish work in progress, completed work, and failures needing review. The exact ordering depends on the system performing the action, not simply on calling the connection a webhook.

Test retry outcomes

Send the same test event twice, then send concurrent copies, and simulate interruption after processing begins. Check the resulting record count and whether diagnostic evidence explains the outcome without unnecessarily exposing secrets or customer content.

Also test a legitimate update to the same business record. Duplicate prevention should not reject a valid change of state. Keeping event identity separate from customer or order identity helps distinguish those cases.

Start with the messaging and CRM contract guide. Before enabling consequential actions on real records, verify duplicate and failure scenarios in a dedicated test environment.