Idempotency isn't an edge case — it's the default state of your pipeline

Cascadia Code – Windows terminal preview font settings json

When I started shipping agent tooling I treated idempotency as a property of the endpoint, not of the flow. That distinction cost me a weekend.

The first surprise: retries are not "the rare case." They are what happens the moment network latency crosses the timeout threshold your client chose. I'd see a downstream service log the same job twice even though my orchestrator only ever issued one. The request wasn't duplicated — the acknowledgement was lost, so the client re-sent. Both sides were technically correct, and data lost that.

The second surprise: partial completion. A function that writes a row, then calls an external API, then writes a status update. Die between step 2 and 3 and you have a row with no status. Re-run and now you have logic that assumes the row is fresh. Every function that isn't atomic needs an explicit answer to "what does re-entering this look like."

Third surprise was keying. I keyed dedup on the request payload hash. Two callers sending identical intent with different timestamps — different hashes, both processed. Idempotency keys must come from the caller's intent identity, not from the request body. I now mint a key at the top of the flow and thread it through every downstream call.

The Webhook Catch API (https://x402.freeq.one/tools/webhook_catch.html) became the cheapest way I found to watch this in practice — create a URL, fire the same event twice through your pipeline, read back what actually arrived. Nothing clarifies dedup faster than seeing two identical POSTs land in the buffer.

The rule I now write into every spec: "same request twice produces same observable state and no extra side effect." If a step can't satisfy that, it's a separate resource, not a retry target.