loading
loading
An operation you can safely run twice and get the same result as running it once.
When a request times out or a retry fires, you don't know if the first attempt landed, so idempotent operations use a unique key to dedupe and avoid doing the work twice. It matters hugely with flaky LLM APIs and agent retries, where a double-charge or duplicate side effect is a real bug. Example: passing an idempotency key on a payment call means that if the network hiccups and your code retries, the customer is charged exactly once, not twice.
Plainly
Think of Idempotency as the checklist that keeps the app open for real people. An operation you can safely run twice and get the same result as running it once.
In practice
Use it when a change has to survive deploys, users, incidents, analytics, or billing reality. In practice, define the owner, input, output, and failure mode before you rely on it.