Skip to content

Skill · production · durable-execution

Durable execution

Run the agent as a reducer over one serializable blob with launch/pause/resume, idempotent tools, and crash replay. Use when a customer will wait, HITL must survive, Inngest/LangGraph checkpoints, or the demo works on a laptop.

GET /api/canon/skills/durable-execution?format=md

Factors 5, 6, 12. The ticket is the agent state. Crashes replay. Humans resume. Double side effects are a product incident.

When

A demo works on your laptop and a customer will wait on it.

Do

  1. 01

    One blob

    Business fields and loop fields together. Reconstruct the next LLM call from the blob plus pinned prompts.

  2. 02

    Boring APIs

    Launch, pause, resume. Interrupts are first-class. Gateway from mail/chat/cron/webhook into the same reducer.

  3. 03

    Idempotent tools

    Keys, journals. 'Already refunded' is visible. Retries do not charge twice.

Don't

  • A second agent_memory table that drifts from the ticket.
  • Restart the agent after the human answers.

Hard rules

  • (state, event) → (newState, effects).
  • Pause serializes; resume does not re-execute.
  • One orchestrator.

Refuse

  • HITL that cannot resumeThe human answers and the run is gone. Approval as a side channel, not a tool.
  • Double side effectsNon-idempotent tools, no journal. A retry refunds twice.
  • Unbounded loopNo max-turns, token, wall-clock, or money budget. The agent rambles until the bill or the context dies.

Load with this

Load next

Trigger tests

Should fire

  • The agent dies if the server restarts
  • Durable graph with HITL
  • Inngest vs LangGraph checkpoints

Should not

  • A one-shot classifier