Sections
ϟPULSSIX
Automation / Evergreen guide

Idempotency explained: keep an automation from charging, emailing or creating records twice

Design stable event identities, durable processing state and safe recovery for duplicate deliveries.

PULSSIX Desk /
2 min read (approx.)
Idempotency explained: keep an automation from charging, emailing or creating records twice
Original editorial infographic · PULSSIX
In this article
  1. Why duplicates happen
  2. Give a logical operation a key
  3. Store progress durably
  4. Use provider guarantees where available
  5. Prove it with a small experiment
  6. Explore the topic

Why duplicates happen

A webhook sender may deliver the same event again because the receiving application did not acknowledge it in time. A worker can crash after performing an action but before saving its own status. Exactly-once delivery should not be assumed. The receiving workflow must be designed to tolerate repeats without repeating unwanted side effects.

Give a logical operation a key

Use a provider event ID or a stable business identifier for the specific intended operation. A new random identifier on every retry defeats duplicate detection. By contrast, reusing an identifier for genuinely different operations can discard valid work. The key must identify the business action at the right level, such as a particular invoice reminder for a particular date.

Store progress durably

Maintain a record of the key and processing status in durable storage. A simple check followed by a separate write may still race when two workers process the event simultaneously; use an atomic claim or unique constraint when your storage permits it. Define how abandoned in-progress records can recover rather than blocking future work indefinitely.

Use provider guarantees where available

Some external APIs accept an idempotency key and return the result associated with the previous request. Read the provider’s exact guarantee, including retention periods and whether different parameters can reuse a key. Other actions, such as sending an ordinary email, may offer no comparable guarantee. In that case reconciliation or human review may be needed.

Prove it with a small experiment

Send the same fake event twice, run two workers at once and simulate a failure after the external action succeeds. Verify the count of actual records or messages, not just execution logs. Minimise stored personal data and make failed operations visible. Good retries require good identity; the two mechanisms belong in the same design review.

Primary source · Stripe · Idempotent requests

Explore more: Automation stories · Free tools

Explore the topic

Explore the collection: Automation library