n8n workflow creating duplicate CRM records: causes and fixes
When an n8n workflow creates duplicate CRM records, check whether the same event started multiple executions or one execution supplied repeated items to the write node. Use a stable contact key for CRM upserts and a separate, durable event key for submission retries. A lookup before create reduces duplicates but cannot by itself protect two concurrent executions.
1. Find where the second write starts
Compare the source event ID, n8n execution IDs, write-node input and resulting CRM IDs for one duplicated record. If one execution supplies two matching input items, fix that input or mapping. n8n nodes generally process incoming items individually, so two items can mean two create operations.
For matching event IDs across executions, check sender retries and manual replays. Do not assume that a timed-out create failed: reconcile the CRM before retrying it.
Sources: n8n data flow, replaying saved execution data and request retries.
2. Use different keys for a person and an event
A CRM contact key identifies the person or account. A submission key identifies one enquiry or event. The same person can legitimately send a new enquiry, while the same submission can be delivered again after a timeout.
| Key | Purpose | Example test value |
|---|---|---|
| Contact identity | Find or update the same CRM contact | sample@example.test |
| Event identity | Recognise the same submission being retried | SAMPLE-EVENT-001 |
| Execution ID | Trace a particular n8n run | A new execution is not a new business event |
Choose a stable source event ID or agree an idempotency key with the sender. Preserve it across retries; generating a fresh random key on every delivery defeats the check. Agree the matching policy; n8n does not supply an automatic guarantee for every event.
3. Prefer an upsert; treat lookup-before-create as incomplete
Where the CRM offers a suitable update-or-create operation, use its documented match key rather than an unconditional create. For example, n8n’s HubSpot node offers Create/Update a contact. Check the destination’s matching rules and decide which fields may overwrite existing data.
A lookup followed by an IF and Create branch is not an atomic claim. Two executions can both see no existing record before either creates one. Use a destination uniqueness rule or durable event claim; keep the lookup for record selection and update rules.
Sources: HubSpot operations and the Postgres node’s documented unique-conflict handling. The concurrency warning is a design consequence of separate lookup and create operations.
4. Claim the submission in durable storage before side effects
Keep a durable event ledger with a unique key and explicit state. Only the winning claim starts protected work. n8n’s Postgres node supports inserts, unique-conflict handling and query parameters; uniqueness comes from the database constraint.
Validate event key
Attempt unique claim in durable storage
new claim -> perform protected work -> save result and CRM ID
duplicate -> read stored state and return or reconcile itDistinguish processing, completed and failed or uncertain outcomes. Return a completed event’s recorded result. Reconcile interrupted or uncertain events instead of creating again, and assign responsibility for abandoned claims.
The ledger and a remote CRM write are separate systems. A crash between them still needs recovery logic. Do not describe a ledger alone as an exactly-once guarantee.
Source for the n8n database operations: Postgres node. The state and recovery contract above is an implementation recommendation.
5. Choose the right Remove Duplicates mode
n8n’s Remove Duplicates node can compare items within the current input or compare values with history from previous executions. Pick the mode that matches the problem; removing duplicates in one input does not remember later webhook deliveries.
Previous-execution mode has configurable scope and history size. It is a useful filter, but do not assume its retained history and your CRM write form one atomic transaction. Check what happens when the filter records an event and the subsequent write fails; keep a recovery route for that event.
6. Make retries and notifications follow the same event
Retry On Fail repeats a failed node attempt; it does not decide whether the remote operation already succeeded. Before retrying a create after an uncertain response, use the destination’s idempotency support or reconcile by the agreed key. For longer rate-limit delays, n8n documents batching or Loop Over Items with Wait; bounded retries are not a substitute for write safety.
Protect notifications separately: updating one contact can still trigger duplicate Slack alerts. Track delivery by event and reconcile uncertain results.
Source for retry behaviour: n8n rate-limit handling. See our published template 21332; check its writes and retries before adapting it. The Kutu order-intake project includes a recorded sample-data run with duplicate and review states.
7. Test replays, parallel calls and uncertain results
- Replay one labelled event ID twice: expect one protected write and the recorded duplicate outcome.
- Submit the same contact with a new event ID: expect the agreed new-enquiry behaviour without another contact.
- Send the same event concurrently in a sandbox: only one execution may win the protected claim.
- Simulate a response loss after the destination write: reconcile the result before another create.
- Fail the write after the claim: verify that the event can be recovered rather than silently skipped forever.
- Check CRM records, ledger state and notification counts separately; a green execution alone is not proof.
Use a sandbox or isolated test destination with clearly labelled sample records. For webhook delivery problems, begin with the production webhook checklist so retries do not hide the original fault.
FAQ
Is looking up a CRM contact before creating it enough?
Not when executions can overlap. Two lookups can both return no record. Prefer the destination’s suitable upsert or uniqueness rule and use a durable event claim where repeated side effects must be prevented.
Does n8n Remove Duplicates remember earlier executions?
It has a mode for previous-execution history as well as a current-input mode. Check its configured scope and history size, and plan recovery if a later CRM write fails.
Should I use the n8n execution ID as the idempotency key?
Use a stable business event or submission key for replay protection. Different n8n executions can be retries of the same event, so their execution IDs are useful for tracing but not for identifying a new enquiry.
Sources
- n8n: data flow, execution debugging and retry/rate-limit handling.
- n8n: HubSpot, Postgres and Remove Duplicates.