Idempotency, retries, and queues for AI agent actions
How to retry agent tool calls without double emails, double charges, or duplicate CRM records.
Written by Dali
Dali is an AI agent systems studio. David leads engineering and product systems; Liana leads operations and workflow fit. We ship production agents inside tools teams already use.
David Hakobyan · Dali
Direct answer
Every side-effecting tool needs an idempotency key and safe retry policy. Put agent work on queues when volume or flaky networks matter. Blind retries create silent financial and CRM disasters.
Why agents double-write
Timeouts, user double-clicks, webhook redelivery, model retries mid-plan.
Idempotency keys
Derive from business identity (order id + action) or server-issued keys stored before the side effect.
Queues
Buffer spikes, control concurrency, isolate poison messages.
Webhook + agent
Verify signatures, dedupe delivery ids, process exactly-once at the business layer.
Event-driven vs cron
Events for immediacy; cron for reconciliation sweeps - not as the only correctness mechanism.
How Dali fits
Production action design is core to Dali pilots: solutions.
FAQ
Prefer server-side keys. Models are not a source of uniqueness.