Play · Developers and platform teams
Resume a run where it stopped
A run picks up where it stopped,even after the process dies.
WorkflowEnvelope is the boundary that makes a run survivable: each ctx.tool call checkpoints its result, so a crash, a redeploy, or a pause for a person resumes from the first step without one. You don't construct the envelope; you decide where the checkpoints fall.
30 minutes. No commitment.
SOC 2 Type II attested · ISO/IEC 27001:2022 certified · HIPAA with a BAA · aligned to the EU AI Act and NIST AI RMF

Who
A platform team running a report builder that fetches finance data, summarizes it, and waits for a controller's answer before it posts.
What happened
A redeploy during a long run restarted it from the top, re-fetched everything, and asked the controller the same question twice.
What's at stake
Runs that outlive the process that started them with no saved state, a crash that looks like an agent error, and code that waits for COMPLETED and hangs forever on a run that was blocked or killed.
- 01Run
Make the tool the unit of work.
Under @agent, each @tool is a durable step and each ctx.tool(...) inside a @workflow is a checkpoint boundary; ctx.tool, ctx.domain and ctx.llm.generate are all awaited. Before a step runs the runtime records that it is starting, and after it completes the result is checkpointed. On resume, any step with a saved result is restored from that result and the function does not run again; execution continues from the first step without one. Work done between tool calls is not checkpointed, so if a computation is expensive enough that you would hate to repeat it, put it in a @tool. There is no durable=True flag and no separate durable workflow type.
@agent · @workflow · @tool · ctx.tool(...) is a checkpoint · restored from the saved result · no durable=True
runtime · deployed agents
- 02Run
Pause for a person. Hold no compute.
ctx.ask_user puts the run in PAUSED, and PausedReason says what it is waiting on: awaiting_user for a human answer, awaiting_approval for a governance approval, awaiting_child for a spawned sub-agent, awaiting_signal for an inbound signal, awaiting_timer for a scheduled wake-up, suspended_orphan when its parent went away. A paused run holds no compute and moves through RESUMING when the thing it was waiting on arrives. For a domain action you mark human_in_the_loop: true, attach an approval policy and a person approves each call before it proceeds.
PAUSED · awaiting_user · awaiting_approval · awaiting_child · awaiting_signal · awaiting_timer · suspended_orphan · RESUMING
run states · PausedReasonRUNNING → PAUSED → RESUMING → RUNNING# PAUSED holds no compute. PausedReason says why:awaiting_user: a human answer (ctx.ask_user)awaiting_approval: a governance approvalawaiting_child: a spawned sub-agentawaiting_signal: an inbound signalawaiting_timer: a scheduled wake-upsuspended_orphan: its parent went away - 03Prove
Four terminal states, and INTERRUPTED is not FAILED.
A run moves through PENDING, RUNNING, PAUSED and RESUMING, and ends in one of four terminal states: COMPLETED, FAILED, BLOCKED or INTERRUPTED. BLOCKED means governance stopped it, a policy or a budget, and the run finishes with a recorded decision and an ExecutionIncident, not an exception. INTERRUPTED means the process died under it, SIGTERM, OOM or a hard kill, and it is deliberately distinct from FAILED because collapsing them hides infrastructure issues; a reconciler finalizes a run whose host died mid-run. Poll for all four, or your code hangs on a blocked or killed run. In production, checkpoints persist to the database and survive restarts and redeploys; local development uses an in-memory backend whose state does not survive a restart.
COMPLETED · FAILED · BLOCKED · INTERRUPTED · ExecutionIncident · reconciler · checkpoints persist to the database in production
observe · blocked run detail
- ctx.tool fetch_data · quarter Q3report_builder · run 4471 · build · checkpoint saved · result keptallow
- ctx.ask_user · 'post to the ledger?'report_builder · run 4471 · PAUSED · awaiting_user · no compute heldhold
- ctx.tool fetch_data · quarter Q3report_builder · run 4471 · resume · RESUMING · restored from the saved result · not re-runallow
- ctx.tool summarizereport_builder · run 4482 · step 3 · BLOCKED · budget policy · ExecutionIncident recordedblock
Illustrative entries in the shape the product writes them.
Products in this play
Every tool call. A workflow's ctx.tool calls are its checkpoints; there is nothing to turn on. Work between tool calls is not saved, so expensive computation belongs in a @tool so its result is.
Run this play this week.
Free for your first agents and devices, live in about thirty seconds. Or walk through it with someone who has run it before.
30 minutes. No commitment.
SOC 2 Type II attested · ISO/IEC 27001:2022 certified · HIPAA with a BAA · aligned to the EU AI Act and NIST AI RMF