Skip to content
Courses/Agents and automation/Retries, idempotency, and exactly-once

Retries, idempotency, and exactly-once

Retrying an LLM call can change the reasoning, choose a different tool, or execute a critical action twice. In agents, blind retry is production debt.

  • Distinguish model retry, tool retry, and workflow retry.
  • Design idempotent actions for payments, emails, tickets, and data changes.
  • Create an execution table that blocks duplicates.
Terminal
tabla_tool_executions:
  idempotency_key: "invoice-email:cliente-42:2026-07"
  tool: "send_email"
  status: "completed"
  result_id: "msg_abc123"

regla:
  si existe completed con misma key:
    devolver result_id anterior
    no ejecutar tool otra vez
  si existe running:
    esperar o marcar conflicto
  si falla:
    guardar error y decidir retry con humano

Safe pattern

  • Generate an `idempotency_key` before calling the tool.
  • Record `running` before the external effect.
  • Mark `completed` only when the provider confirms.
  • On retry, check the table before acting.
  • For irreversible actions, add human approval.
Complete Aulafy mapSee how this lesson fits without leaving your path.

Complete Aulafy map

How all courses connect

This is not a checklist. Start with the foundation, choose an outcome, and go deeper only when your project needs more control.

  1. 1Understand
  2. 2Apply or build
  3. 3Operate with confidence
01

Choose an application

Turn the foundation into a visible outcome: a website, a business improvement, media, or an interactive experience.

Continue into the technical branch when you need to maintain code, data, or infrastructure.

02

Build with code

Prepare your environment, work with coding agents, and run models while keeping control of your projects.

This branch prepares you to design and operate reliable AI systems.

03

Take systems to production

Combine retrieval, agents, evaluation, security, deployment, and model adaptation when the problem requires it.

You do not need every course: choose the component your system needs and return as it grows.

View full catalogue