Prompt
Why does my automation keep duplicating records after retries?
Latest observation
Nov 22, 2026
OpenAI APIWeb search: off
This usually happens because the automation is not idempotent: when a run retries, it repeats the same “create” action and makes a new record instead of recognizing that the record already exists.
Common causes:
-
Create-on-retry behavior
- The workflow fails after creating a record but before marking the job as complete.
- On retry, it runs the create step again.
-
No deduplication key / unique identifier
- If each run doesn’t use a stable ID (like an external order ID, email, transaction ID, etc.), the system can’t tell it’s the same item.
-
Retry logic at the wrong layer
- Some platforms retry the whole workflow, not just the failed step.
- That can re-execute side effects like database inserts.
-
Timeouts or ambiguous failures
- The record may actually be created, but the automation times out waiting for confirmation.
- It retries, assuming the create failed, and creates a duplicate.
-
Event re-delivery / webhook duplication
- If your trigger is a webhook or event stream, the source may resend events until acknowledged.
- Without deduplication, each delivery creates another record.
How to fix it:
- Use an idempotency key or unique external ID for each source item.
- Prefer upsert over create:
- “Create if not exists, otherwise update.”
- Store a processed marker / ledger:
- Save the source event ID after successful processing.
- Make retries safe:
- Retry only read/lookup steps, or ensure the write step checks for existence first.
- Add a unique constraint in the database:
- This prevents duplicates even if the automation misfires.
- Separate side effects from processing:
- Determine the result first, then write once.
If you want, I can help you diagnose the exact failure mode if you share:
- the automation platform,
- what triggers it,
- the step that creates the record,
- and whether retries happen on the whole workflow or just one action.