Salar Saeedi

Automation & agents · Analysis

What if an agent crashes after it writes?

Recover a workflow that loses its own progress after an external system has already applied the change.

Salar Saeedi1 min read
Three-stage illustration — What if an agent crashes after it writes?

A job creates an invoice and its worker restarts before it stores the returned invoice ID. When the job resumes, the local status still says pending. A clean new model turn cannot tell whether the external call succeeded.

Keep intent separate from receipt

Persist the logical action ID and intended fields before making the external call. Durable workflow products such as Temporal reconstruct progress from recorded event history. The external system still needs its own way to recognize repeated calls.

Source · Temporal · Workflow execution

Make repeats refer to one operation

If the provider supports an idempotency key, reuse the same key for retries of that intent. Stripe documents request idempotency. Cloudflare also notes that at-least-once delivery can surface duplicate messages, so consumers need a way to recognize repeats.

Source · Stripe · Idempotent requests · Cloudflare Queues · Delivery guarantees

Give uncertainty its own status

If the provider cannot prove whether the effect happened, show outcome unknown, investigate using available references and pause the next write. Reproduce the crash between success and receipt recording in a test environment.

What to take away

A durable flow recovers evidence of the effect before deciding whether to execute again.

References

Related work in the portfolio