AI & Automation
How do I prevent automations from creating duplicate contacts, orders, or tasks?
The short answer
Choose one stable unique key, search or upsert before creating, and make retries safe. Then monitor duplicate rate and keep a careful merge process for the records that still slip through.
Pick the right identity
For contacts, a normalized email may work, but families can share addresses and people can change them. For orders, use the source system’s order ID. For tasks, combine the source event ID and task type. Do not use a person’s name as a unique key.
Store the source system, source ID, event ID, and created timestamp in the destination. Normalize values deliberately: trim spaces, standardize email case, and format phone numbers without discarding country information.
Make creation conditional
Use this sequence:
- Receive event with a unique event ID.
- Check whether that event was already processed.
- Search the destination by stable key.
- Update the existing record or create one new record.
- Save the event result.
- Confirm the destination ID.
For APIs, use supported idempotency. Stripe explains that an idempotency key lets a client retry the same request without repeating the operation (Stripe idempotent requests). Each provider handles this differently, so follow its documentation.
Test the duplicate paths
Send the same event twice, submit the same email with different capitalization, retry after a timeout, and change a contact’s email. Check simultaneous submissions if the workflow may receive them. A “find then create” sequence can still duplicate when two runs happen together, so use atomic upsert or database uniqueness when available.
Create a weekly exception report: possible duplicates, records without source IDs, and repeated event IDs. Merge only after deciding which record is authoritative and preserving needed history. For orders and money, do not merge casually. Reconcile with the source system.
Sources and further reading
A free next step
You don't have to build this alone
Bring your questions, share what you're working on, and meet other women building businesses from home. It is free to join.
Related Questions
- How do I build and test a simple automation from trigger to confirmation?
- What should I check first when a business automation stops working?
- How do I automate customer follow-up without making messages sound robotic?
- How do I schedule or automate social posts without hurting engagement or losing control?
Related WAHMN resource
If you want a broader, practical system for using AI in a small business while keeping human judgment in charge, AI Advantage takes the work further. See AI Advantage.
