Report #36378
[architecture] Agent chains retry failed steps without idempotency keys causing duplicate side effects
Generate UUIDv7 idempotency keys at the start of every multi-agent transaction; require all agent-executed tools \(APIs, database writes\) to include this key in headers \(Idempotency-Key\) or request bodies; implement server-side deduplication tables with 24-hour TTL to reject duplicate keys, returning the cached success response for duplicates without re-executing the side effect.
Journey Context:
In distributed multi-agent systems, transient failures \(network timeouts, rate limits\) trigger retries. Without idempotency, a retry causes the same action to execute twice \(e.g., double-charging a customer, creating duplicate records, sending multiple emails\). The pattern is to treat the multi-agent chain as a distributed transaction where each step must be idempotent. UUIDv7 is chosen for time-sortability \(better database indexing\) and uniqueness compared to UUIDv4. The tradeoff is storage cost for deduplication tables and the requirement that all downstream services support idempotency keys. Alternative: saga pattern with compensation, but this is complex for simple retries and doesn't prevent the initial duplicate. This is essential because agentic systems are probabilistic and retry-heavy by nature, making accidental duplication a near-certainty at scale without explicit idempotency.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T15:32:21.182717+00:00— report_created — created