Your AI agent re-sends the email on retry: an outbox for side effects
Description and use
The outbox pattern records intent as state and performs I/O after commit, eliminating duplicate emails on retries and replays.
Problem
Agent frameworks that perform I/O inside a step cause duplicate side effects when the run is retried, resumed, or replayed.
Outcome
Using an outbox pattern with reactifact prevents duplicate emails on retries, resumes, and replays, while preserving idempotency and enabling accurate replay without side effects.
Workflow
- 1. Define a produce that records a PendingAction intent using effects.act() instead of performing I/O.
- 2. Commit the produce’s effects atomically with other state changes.
- 3. After commit, the runtime dispatcher processes each pending intent once per stable id.
- 4. The dispatcher performs the actual I/O (e.g., send email) and records the outcome as state.
Evidence
Most agent frameworks model a step as "do some work, then call the tools."
The outbox inverts the order: 1. The produce records an intent — an artifact called PendingAction — and does no I/O.
Replay reconstructs the answer without re‑sending anything.
The runtime drains the outbox after each generation's commit, marking each action dispatched or failed.
- Record date: 2026-10-10T00:41:12.651Z