What is Idempotency?
Idempotency: The property that running the same operation more than once has the same effect as running it once, preventing duplicate charges, emails, or records.
An operation is idempotent if repeating it does not change the result after the first time. Setting a value is naturally idempotent; adding to a balance is not. In distributed systems, requests get retried all the time (network timeouts, webhook redeliveries, crashed workers), so any operation that creates something or moves money needs to be made idempotent deliberately.
The usual technique is an idempotency key: a unique ID attached to the request (a webhook event ID, an invoice number, a client-generated key). Before doing the work, the system checks whether it has already processed that key and, if so, returns the earlier result instead of repeating the action. Payment APIs such as Stripe support an Idempotency-Key header for exactly this reason.
Why it matters when you build or buy AI
AI agents and automations retry more than humans do, and an agent that retries a "send refund" tool call can refund twice. Every tool or step that writes data, sends a message, or moves money should be idempotent. Ask your builder to show you where the idempotency keys are. If they cannot, expect duplicates in production.
Example
An invoice posting step uses the vendor ID plus invoice number as its key. When a timeout causes a retry, the accounting system already has that bill, so no duplicate is created.
Related terms
More in Engineering
Book 20 minutes, or send a brief
A former CTO replies. You leave with a written plan and a fixed estimate.
Prefer LinkedIn? Connect with Harish.