If your automation cannot retry safely, it is not production-ready.
Start here:
Why duplicates happen
Duplicates are usually caused by one of these:
- Side effects executed before the workflow recorded a stable checkpoint
- Retries that don’t reuse a stable idempotency key
- “Best effort” fallbacks that silently change behavior across reruns
A safe rerun model (practical, not theoretical)
1) Define checkpoints that are persisted
Each step should be:
- explicit
- persisted
- re-runnable without ambiguity
2) Use stable identifiers for side effects
When an external side effect occurs (send, post, create), it must have a stable key so reruns do not duplicate it.
3) Fail closed when the system is unsure
If evidence or prerequisites are missing:
- block the action
- log the reason
- route to a review queue
Deterministic fallbacks
AI is helpful when governed.
Fallbacks should be:
- explicit
- deterministic
- logged
So operators can understand what happened and why.
Related: