AI ToolsACADEMY
AI Tools Academy
0 / 117 (0%)

Agents, tools and controlled automation · Module 1: Agents, tools and controlled automation in practice

Retries, idempotency and duplicate actions

Concept · 12 minProduct guidance last checked: 21 October 2026

Learning outcome: Handle an uncertain write without blindly repeating it.

A timeout does not always mean an operation failed. A server may have performed the write while the response was lost. Retrying without checking can create duplicate tickets, messages or orders.

Idempotency means repeating an operation has the same intended effect as performing it once. Some services support an idempotency key that identifies one logical operation. Where that is unavailable, use an authoritative status lookup or another suitable deduplication design. Record the operation identity and distinguish confirmed failure from unknown outcome. Never let an agent equate silence with permission to repeat a consequential action.

Worked example

A fictional draft-creation call times out after the server stores draft D-104. The assistant repeats the request and creates D-105. A safer design keeps a stable operation key, checks whether the first draft exists and returns that identifier when appropriate. The user should not have to discover duplicated work later.

Try it yourself

Draw the success, confirmed rejection and timeout branches for creating a draft. State which branch may safely retry and what evidence is needed first.

You can do this exercise on paper. If using an assistant, keep to the fictional material and an approved tool.

Compare your approach

A confirmed validation rejection can be corrected without implying a prior write. A timeout enters an unknown-outcome branch. Resolve that state with the service’s supported mechanism before creating another logical operation.

Check your understanding

After a write request times out, what should be assumed?

  1. The outcome may be unknown until checked
  2. The write definitely failed
  3. The write definitely succeeded
Show the answer and explanation

Answer: The outcome may be unknown until checked. The server may have performed the write before the response was lost. Resolve the unknown outcome using a supported status or idempotency mechanism before repeating the logical operation.

Workbook

Download the course workbook to record your answer and compare it after the knowledge check.

Further reading