Blog

1 min readBuilding & Operating AgentsTutorial

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 Northstar

Northstar is an AI agent systems studio. Alex leads engineering and product systems; Jordan leads operations and workflow fit. We ship production agents inside tools teams already use.

Alex Morgan · LinkedIn · Northstar

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 Northstar fits

Production action design is core to Northstar pilots: solutions.

FAQ

  • Prefer server-side keys. Models are not a source of uniqueness.