Skip to main content

Pause, resume and replay

A run can stop partway and pick up later, on the same record, even after the server restarts. A block that needs an answer from a user, such as an approval or a form, stops the run and saves where it was. The answer continues that run. Steps that finished before the stop are not run again: their saved output is reused. That reuse is the replay. A run that a crash cut short continues the same way.

A paused run holds no process. The block that paused runs again from its top, so this page lists what runs again, what is kept, and who may answer.

A request is one run of an action. The tables below follow one flow, refunds: loadOrder reads an order, then approveRefund asks a user to approve the refund and pays it.

src/flows/refunds/blocks/approve-refund.ts
import { handler } from "@flow-state-dev/core";
import { z } from "zod";

export const approveRefund = handler({
name: "approve-refund",
inputSchema: z.object({ orderId: z.string(), amount: z.number() }),
outputSchema: z.object({ refunded: z.boolean() }),
execute: async (input, ctx) => {
await ctx.runOnce!("notify-reviewer", async () => {
const res = await fetch("https://chat.example.com/notify", {
method: "POST",
body: JSON.stringify({ text: `Refund of ${input.amount} waits for approval` }),
});
return res.status;
});

const answer = await ctx.suspendForUser({
kind: "approval",
prompt: `Refund ${input.amount} on order ${input.orderId}?`,
deadline: 24 * 60 * 60 * 1000,
});
if (answer.cancelled || !answer.approved) return { refunded: false };

await fetch("https://payments.example.com/refunds", {
method: "POST",
headers: { "Idempotency-Key": ctx.idempotencyKey! },
body: JSON.stringify({ orderId: input.orderId, amount: input.amount }),
});
return { refunded: true };
},
});
src/flows/refunds/flow.ts
import { defineFlow, sequencer } from "@flow-state-dev/core";
import { z } from "zod";
import { approveRefund } from "./blocks/approve-refund";
import { loadOrder } from "./blocks/load-order";

export const refundsFlow = defineFlow({
kind: "refunds",
actions: {
refund: {
block: sequencer({ name: "refund" }).step(loadOrder).step(approveRefund),
inputSchema: z.object({ orderId: z.string() }),
},
},
});
src/flows/refunds/blocks/load-order.ts
import { handler } from "@flow-state-dev/core";
import { z } from "zod";

export const loadOrder = handler({
name: "load-order",
inputSchema: z.object({ orderId: z.string() }),
outputSchema: z.object({ orderId: z.string(), amount: z.number() }),
execute: async (input) => {
const res = await fetch(`https://orders.example.com/orders/${input.orderId}`);
const order = (await res.json()) as { total: number };
return { orderId: input.orderId, amount: order.total };
},
});

loadOrder finishes before the stop, so a resume skips it. approveRefund runs again from its top: the notification is guarded by runOnce, and the payment carries the request's idempotency key.

A request's states​

A request's states
Four boxes. In progress moves to suspended when approveRefund calls suspend, and suspended moves back to in progress when the request is answered. In progress moves to a final box holding completed, failed, aborted and incomplete. Dashed arrows, which apply only after a crash, run from in progress to interrupted when the heartbeat stops and back when the request is continued, and from interrupted to the final box when it is discarded. Suspended is highlighted: the request waits for an answer. Notes say that one request keeps one id and one item log through every pause, that a stop ends a suspended or interrupted request as aborted, and that a suspended request is never marked interrupted.STATUSsuspendedapproveRefundwaits for an answerSTATUSin_progressapproveRefundis runningSTATUSfinalcompleted · failedaborted · incompleteSTATUSinterruptedapproveRefundheartbeat went quietSUSPENDANSWERENDSNO HEARTBEATCONTINUEDISCARD01One request keeps one id and one item log through every pause.02A stop ends a suspended or an interrupted request as aborted.03A suspended request is never marked interrupted.MOVES TOONLY AFTER A CRASHWAITS FOR AN ANSWER
MoveCause
in_progress to suspendedctx.suspend throws SuspensionError. The request's status becomes suspended, a pending suspension record is stored, and the stream carries a suspension item and a request.suspended event before it ends.
suspended to in_progressA resume, an answer or the sweeper continues the request. If a stop got there first, the run ends before any block executes.
in_progress to a final statuscompleted, failed, aborted or incomplete.
in_progress to suspended againA later ctx.suspend in the same run.
in_progress to interruptedThe stale-request sweeper finds a heartbeat older than the threshold (Interrupted requests).
interrupted to in_progresscontinue, which keeps the request id, or the sweeper finishing a gate that was already resolved.
suspended or interrupted to abortedA stop. See Stopping a paused request.

While a request is paused it holds:

HeldDetail
The request recordStatus suspended and the items so far. A pause does not close the record: GET returns the whole pause-and-continue history on one record.
One suspension recordStatus pending until answered (Stores).
Recorded block outputsThe block_trace items of blocks that finished.
The sequencer checkpointWritten at the pause, even when nothing changed.
The token budgetA suspended request saves what it spent and the resume restores it, so both runs count against one budget.

The order of items across a pause, the suspension_resume and continuation items with their resolution values, and resuming a stream after a pause are in Items and the stream.

What ctx.suspend takes​

CallSignature
ctx.suspend(options) => Promise<unknown>. Optional on the context type, so TypeScript code writes ctx.suspend!(...).
ctx.suspendForUser(options) => Promise<answer>. Not optional. Shape under ctx.suspendForUser.
OptionTypeMeaning
reason"user_approval" | "user_input" | "external_event" | stringRequired. user_approval and user_input make the stop a user's stop, the kind the answer route takes. Any other string is a custom gate.
messagestringThe body shown with the stop, markdown allowed. Omitted, the text is Flow suspended: <reason>.
allowResumeAction[]What an answerer may do. Defaults by reason: user_input gives ["submit"]; every other reason gives ["approve", "reject"]. Add "skip" for an optional step.
timeoutMsnumberDeadline, counted from the call. Omitted or 0, the pause has no deadline.
resumeSchemaZod schema or JSON SchemaStored as JSON Schema. The resume and answer routes check submit, and an approve that carries data, against it.
suspensionIdstringA name you choose, unique within the request and the same on every replay of the call. Omitted, one is minted.
OptionTypeMeaning
titlestringA short heading.
dataRecord<string, unknown>Stored on the record and carried on the suspension item. Client-visible, so keep secrets out.
render{ component, props? }A hint for the client screen.
kind"approval" | "review" | "input"Set by suspendForUser. A raw ctx.suspend leaves it unset. Clients then take the kind from reason.

What ctx.suspend returns​

SituationResult
First reach, on a durable hostThrows SuspensionError, a control-flow signal. Rescue handlers do not fire for it and it is not a block failure. The request pauses.
The resuming action is approve or submitReturns the payload, or undefined when none was sent.
The resuming action is skipReturns the SUSPENSION_SKIPPED symbol, exported from @flow-state-dev/core. Only resolution: "skipped" is stored.
A gate resolved on an earlier passReturns or throws its recorded outcome, in the order recorded, instead of pausing again.
A gate resolved stoppedNever returns an answer on replay. The run ends aborted at that call.
SituationThrows
The resuming action is rejectSuspensionRejectedError
A gate that allows reject past its deadline (an approval, or a custom gate that allows it)SuspensionRejectedError with expired: true
The gate's task was cancelledSuspensionRejectedError with cancelled: true
A user's review or input past its deadline, including a raw user_input gateSuspensionTimeoutError
The host has no durable execution: durable: false, in-memory stores, or a router given no durability providerA plain Error; the request ends failed and nothing is held. Message: "stopping for a person needs durable execution, which is on by default wherever stores persist. This host has none: it sets durable: false, runs on in-memory stores, or is a router given no durability provider. Remove durable: false, or set durable: true to hold stops in memory (tests only: they are lost when the process ends). Nothing was held."

ctx.suspendForUser​

CallBehavior
ctx.suspendForUser({ kind, prompt, title?, deadline?, resumeSchema?, data?, render? })Stops for a user and returns the answer as a value. Needs durable execution, as ctx.suspend does.
A rejectionOnly an approval returns one as a value. A review or an input has no "no".
kindReturnsAt the deadline
approval{ cancelled: false, approved: true, answer? }, or { cancelled: false, approved: false, deadline, answer? } for a rejection or an expired approval. A no never throws.Reads as a no with deadline: true
review{ cancelled: false, answer }Throws SuspensionTimeoutError
input{ cancelled: false, answer }Throws SuspensionTimeoutError
any, when the task is cancelled while it waits{ cancelled: true }. The block runs to its end and nothing it writes to the task is kept. Any later wait for a user in the run is cancelled at once.
DeadlineRule
deadline on the callMilliseconds, a positive finite number, or the call throws TypeError.
The host's userDeadlineMsUsed when the call sets none. Set on the host: Runtime configuration.
NeitherThe stop waits until answered, stopped or cancelled.

What runs again on resume​

ResumeBehavior
ModeRuns the action again under the same request id, in replay mode.
RestoredSequencer state from the checkpoint, and the recorded output of every finished block.
Which blocks are skipped on resume?
Every block with a completed recorded outputNot run: no execute, no model call, no emit, no state write. Downstream blocks see the same value.
Background blocks (.sideChain(), .sideChainIf(), .forEachSideChain())Same rule. One that finished and recorded is skipped.
A step's onSettled hookDoes not fire for a skipped step.
The request's user messageNot emitted again, on resume or on crash continuation.
Never skippedThe block that paused, and any block marked transient: true.
Where finished is recordedIn the store, so skipping holds across a restart on any store that persists.
Runs againDetail
The block that pausedRuns from its top. ctx.suspend returns the answer, or throws, as above. Anything it did before the suspend call happens again.
A transient: true blockLeaves no record, as does a failed or suspended block, so it runs again.
The generator whose tool pausedCalled once more. Earlier model turns and finished sibling tools are rebuilt from the item log. Only the paused tool re-enters.
Composition callbacks (.map, .stepIf, .sideChainIf, connectors)Run again to rebuild control flow. A Date.now(), Math.random() or generated id in one can pick a different branch on resume. Move it into a block, whose output is recorded, or into runOnce.
A router's execute selectorRuns again and is checked against the recorded decision (Routers).
Background work in flight at a crashRuns again, so its side effects are at-least-once.
MatchingRule
The keyA block's logical id, <requestId>:<path>. The match holds across retries and a restart. The path is what matches: a change that adds, removes or reorders steps between a pause and its resume changes which block a recorded output belongs to.
The pathSegments read root, step[N], iter[N], branch[...] and tool[...].
Sequencer state (ctx.sequencer)Restored from the checkpoint taken at the pause. Each write the paused block made before the pause counts once in the state after the answer, incState and pushState included. During the re-run, before the suspend call returns, a read sees the checkpoint plus the re-run's own writes, so an incState before the pause can read one higher than it will after the answer.
Session, user and org state, and resource writesNot covered by the checkpoint. They run again with the block.
A finished block whose output was over maxRecordedValueBytes (default 262,144)Cannot be injected and is never run again. The request fails with RecordedValueOmittedError. Return less, or pass bulk data between steps with .map.

What an in-memory store keeps, and what durable: true over memory allows: Stores.

Sequencer checkpoints​

A sequencer's durable option is true unless set to false. A durable sequencer writes a checkpoint of its state at each step boundary, one per request and sequencer instance, overwritten each time.

  • A checkpoint holds the sequencer's stateSchema fields, minus those marked transientSlot. A sequencer with no stateSchema, and none around it that has one, writes none.
  • On a resume, a step whose output was recorded does not run again. The checkpoint restores the sequencer's state.
  • A state that fails the sequencer's stateSchema when a step ends skips the checkpoint write. A warning [flow-state] sequencer "<name>" state failed stateSchema validation; checkpoint write skipped for blockInstanceId=<id>. Issues: ... is logged, and the state_snapshot item carries durable: false.
  • With durable: false no checkpoint is written. state_snapshot items stream by tracing level: minimal none, normal the initial and terminal snapshots only, verbose every step. See Environment variables.
  • The action-level durable flag is a different setting, covered on Flows and actions.

Block state that is not a sequencer's is not checkpointed. A block that waits with ctx.suspend() or ctx.suspendForUser() and is answered later runs its body again from the top. Its own state is rebuilt from the schema defaults, and the writes its code makes before the wait are made again. State written by code the resume does not run again is not restored. Keep state that must survive on an enclosing durable sequencer.

Idempotency keys​

A block that runs again must not repeat a side effect. ctx.idempotencyKey and ctx.runOnce guard it.

Behavior
ctx.idempotencyKeyThe string <requestId>:<blockPath>, set per block run. It leaves out the attempt number, so every retry of a step sees the same key. It is also the same on a resume or a continue, which keep the request id. It changes on a retry, which starts a new request. Pass it as the provider's idempotency header, as approveRefund does.
ctx.runOnce(key, fn)The first call for a (requestId, key) pair runs fn and stores the result. Later calls return the stored value. The result must be JSON-serializable.
Within one processConcurrent calls with one key share one in-flight call. An empty or non-string key rejects.
Across a resume or continueThe result is stored in the request store, so the re-run reads it and does not call fn.
ScopeOne request. A retry starts empty. It is not a cache across requests.
AvailabilityDeclared on every block's context.
Who needs itThe paused block, which runs again from its top, and any block in flight at a crash. Put the side effect after the suspend call, or guard it.
Concurrency policiesNot an idempotency key: Concurrency policies.
The gapThe store write happens after fn resolves. A crash between the two leaves no record, so a continuation can run fn again. A failed store write logs a warning, and the in-process result holds for the rest of the process. Passing ctx.idempotencyKey to the provider closes the gap.

Several pauses in one run​

CaseBehavior
Pause, resume, pause again, resumeOne request id and one log: suspension, suspension_resume, items, suspension, suspension_resume, and on. Sequence numbers continue.
Resuming a later gateEarlier gates were resolved on the log. They return their recorded outcome in the original order (answer, rejection or skip symbol) and do not pause again. This works across a restart.
Which gate takes the answerThe one the request is resuming, matched by logical block path and position, and by suspensionId when the call names one. Any other gate reached on the same replay suspends normally.
One block waiting twiceEach unnamed ctx.suspend in the block gets its own resolution, in order.
A second pauseThe next gate can be answered as soon as the request pauses again.

Pausing in a generator​

CaseBehavior
Where the gate livesIn one of the generator's tools: ctx.suspend() in the tool block's execute. A client answers it through the same resume or answer route.
ApprovalThe tool runs its real body after suspend returns, and the model receives the tool's real return value, not the resume payload. The approved tool runs once, and the model is not called again for turns before the approval.
How the conversation is rebuiltFrom the item log: a generator_step item per tool-calling step, holding the assistant text and the tool calls, and the recorded tool_output items. Step 0 also holds the compiled prompt and context, so neither is resolved again.
Finished sibling tools in the same turnInjected from the log. Only the gated tool re-enters.
Rejectionctx.suspend() throws SuspensionRejectedError inside the tool. The generator records a completed tool_output of { denied: true, reason }, tells the model, and goes on. It does not fail.
An expired approvalThe same, with expired: true and a reason that says the approval expired and the tool was not run
A review or input past its deadline inside a toolThe run fails with SuspensionTimeoutError.
CaseBehavior
Two gated tools in one model turnThe first to suspend surfaces. The other reaches its gate on the next resume cycle.
A later gateTwo suspending tools in sequence pause and resume twice, in order. A rejected gate is not re-entered when a later gate suspends.
An ordinary error after the gateA failed tool call the model is told about. A cancel inside the re-entered tool stops the run. A mapModelOutput that throws after an approved gate fails the run.
cacheable on a gated toolDo not set it. A cache hit answers before the tool body runs and skips the gate.
Provider-native tools (providerTools)Calls from an earlier turn cannot be rebuilt, because they record no tool_output.
A dynamic tools resolverIt must keep the pending tool present and unchanged, or the resume fails with GeneratorToolUnavailableError.
Side effects before the gateRun again, unless guarded by runOnce.
A streaming generatorSuspends and resumes too. Recorded turns are rebuilt for the model and not streamed to the client again.

Routers​

CaseBehavior
The decisionA router records it as a router_decision item. On resume its selector (execute) runs again and is checked against the recorded route.
Same pickThe branch continues. Completed work inside it is injected, not run again.
A different pick, or the recorded route is not in the route tableThe resume fails with RouteUnavailableError, code route_unavailable, retryable: false. Its details hold routerName, recordedRoute, reselectedRoute and recordedRouteDeclared.
connectInput mappingA per-call wrapper's mapping the selector returns is kept across the pause.
Any router, including a root action blockResumes on its recorded route.
Route namesTwo different blocks cannot share one route name in a router. Defining it throws, because the decision stores the bare name.
Pure selectorsThe selector, and the mapping function of any connectInput or connectOutput wrapper it returns, should read only the input, because both run again on resume. The framework checks the route name, not that the closures are pure.
ctx.selfReadable in execute. Do not write it there, because execute runs again on resume. Put a .tap(handler) in front and let that write.

The types routes share are on Blocks.

Answering a pause​

The resume and answer endpoints, their checks, status codes and messages, and the clients and screens that call them (RequestHandle, React answerSuspension, the DevTool Suspensions tab) are in HTTP API.

QuestionAnswer
Who may answerThe signed-in caller who reaches the request: the same user and organization when the app authenticates, and otherwise only the tenant check applies. A resumedBy or resumeContext field in the body is ignored.
What the answer recordsresolvedBy (the caller's user id, or the request's owner when the app does not authenticate), resolvedAt, resumeData and the status, on the suspension record and on the suspension_resume item.
Which flow the path namesThe instance recorded as the request's owner. A path naming another copy of the same definition gets 404 on resume, the response for a request that does not exist. retry and continue answer 400 "Flow mismatch: request belongs to flow instance ...".
As whom the action runsThe record's owner, from the stored request, not the caller.
With no event-stream Accept headerThe stream is closed. Read the request through GET .../stream or .../status.
retryNot a resume: a new request id, from interrupted or failed only, with inputOverride allowed.

What each caller gets back from the resume route, for a request Alice owns and Bob, another signed-in user, does not:

Caller and callResult
Bob sends a correct { suspensionId, action: "approve" }404 Request "<id>" not found. The body is the same as for an unknown request or another tenant's, so Bob cannot tell them apart. The pause stays open.
Alice's first approve202 { requestId }, the same id. With Accept: text/event-stream, the live stream of the continuation instead. The answer is recorded with resolvedBy set to Alice's user id.
Alice's second click while the first resume holds its 60 second lease409 Concurrent resume in progress. Try again later.
Alice's second click after the request has left suspended409 Request is "in_progress", not "suspended"
Alice's second click on the answer route, on a stop already resolved409 with refused: "already-resolved"

Interrupted requests and continue​

Setting or factDetail
HeartbeatA run writes one to the active request registry while it works, every 10 seconds by default. A request whose heartbeat is older than the threshold is marked interrupted. A paused request is not touched: it stays suspended.
Sweep interval and threshold30,000 ms and 60,000 ms. Set staleSweepIntervalMs and staleSweepThresholdMs. An interval of 0 or less turns the sweeper off. The threshold should be at least twice the heartbeat interval.
After a restartA request in flight shows interrupted once its last heartbeat is over 60 seconds old and a sweep has run. A finished request is never marked interrupted.
Which storesFilesystem, SQLite and Postgres. On the in-memory stores the record and registry die with the process, so nothing is left to mark.
client.requests.interrupted({ staleThresholdMs? })Has the server sweep, then lists every interrupted request of the user: { id, flow, sessionId?, flowKind, actionName, interruptedAt }. Earlier results appear on every call until continued or removed. staleThresholdMs can only raise the host's threshold.
A request queued on an external runnerNever marked until queuedGraceMs (default 600,000 ms) passes.
ChoiceWhat it does
Continue: RequestHandle.continue(), or POST /:flowKind/sessions/:sessionId/requests/:requestId/continueKeeps the request id, replays the item log, injects every finished block and runs the in-flight step again, so a side effect inside it can fire a second time. Writes one continuation item and no suspension_resume. A step that is a gate nobody resolved pauses again.
Refusals409 unless the status is interrupted (it says to use /resume for a suspended request and /retry for a fresh run), 400 for a session or flow mismatch, 404 for a source that is not re-enterable, 409 for a dynamic scheduled dispatch, and 409 "Concurrent continuation in progress" when another resume or continue is already running on the request.
Discard: RequestHandle.abort(), or POST /api/flows/:flowKind/requests/:requestId/abort (useSession().abortRequest() in React)With no gate holding the request, ends it aborted and removes it from the interrupted list. HTTP 204.
RetryA new request id. See above.

What fsdev run and fsdev chat print and return for a paused request, and where they say to answer it: CLI.

Stopping a paused request​

CaseBehavior
RequestHandle.abort() on a request paused at a gateResolves the gate stopped and ends the request aborted before any block runs. A later approve is 409 has already been resolved. Needs durable execution. Without it, a parked request answers as a finished one: 409 Request "<id>" is already in terminal state "<status>".
A stop that loses a race to an answer409 Request "<id>" was resumed before the stop reached it; stop it again to stop the running turn. The turn runs on.
A stop after an answer the turn never ran pastThe stop wins. The gate is re-recorded stopped, the request ends aborted, and the approved step never runs.
The process dies after a stop is recordedThe sweeper ends the request.
A turn parked on a waitCancels the task it waits on. A run already started on it goes on and its result is discarded.
RequestHandle.abort() on a request running in another process with no browserStops within one heartbeatIntervalMs tick (default 10 seconds) and needs a request store shared across processes.

Under a concurrency policy​

How each policy treats a resumed request, what the resume call returns, and what happens when the wait for a turn fails: Concurrency policies.

Retention and cleanup​

Suspension records​

The record's fields, who owns it, who sees it and where it is stored: Stores.

FactDetail
statuspending, or one of approved, rejected, submitted, skipped, timed_out, expired, stopped or cancelled. Only pending can be answered.
timed_outNever written. A gate past its deadline reads expired.
provider.listSuspended(filter)The filter takes flowKind, userId, sessionId, status, limit, createdBefore and resolvedBefore.

How long a paused run is kept​

QuestionAnswer
How long is a paused run kept?A pause with no deadline stays pending, and the request stays suspended, until someone answers, stops or cancels it. Nothing ages it out: age-based pruning never touches the checkpoints of an in_progress or suspended request, and a pending suspension is not a terminal status, so pruning skips it. A pause survives a restart on SQLite, Postgres and the filesystem store. On the in-memory stores a pause is refused unless durable: true.
What happens to a pause nobody resolves?With no deadline, nothing: it waits. With one (timeoutMs, deadline, or the host's userDeadlineMs), a running server's sweeper expires it at the deadline. What happens next depends on the gate, in the table below.
Whose server expires it?One that serves the routes (fsdev dev, fsdev serve, a self-hosted server). A one-shot fsdev run sweeps nothing. A server reads pending deadlines when it starts, so a gate fsdev run left behind expires on time once a server runs. A gate that passed its deadline while no server ran expires as soon as one starts.
Can a late answer land?The resume and answer routes check expiresAt too and mark the gate expired (410), so an expired gate is not answerable between sweeps or with retention off.
What does a completed request leave?Its suspension records are deleted, with no setting. Checkpoints stay unless flow.request.cleanupCheckpointsOnTerminal is true (default false). Failed and aborted requests keep their suspension records.

At the deadline:

GateWhat happens
An approvalContinues as a rejection marked expired.
A review or an input, including a raw user_input gateContinues with SuspensionTimeoutError.
A custom gate that allows rejectContinues as an approval does.
A custom gate that allows no rejectMarked expired. The resume route answers 410.

Pruning is off unless the host sets durabilityRetention. Its fields and defaults are in Runtime configuration.

Each sweeper tick, whether or not retention is on:

StepWhat it does
Enforce expiryMarks a pending suspension past expiresAt as expired. For an approval, a custom gate that allows reject, and a user's review or input, it also continues the request in the same tick, as above.
Finish what a crash cut shortContinues a request that is suspended or interrupted behind a gate already resolved (answered, expired, stopped or cancelled). It never runs at the same time as a resume of that request.
Finish a stopEnds a request whose stop was recorded while it ran and which then paused.
Fire due wakesSee Background work.
Prune, with retention onResolved suspensions past suspensionTerminalMaxAgeMs, checkpoints of terminal requests past checkpointMaxAgeMs, and an interrupted request's checkpoints past orphanCheckpointThresholdMs.

Which host sweeps on a shared store, and when a router runs the sweeper: Runtime configuration.

Whether a host is durable​

durable on createFlowStatePersisting stores (filesystem, SQLite, Postgres)In-memory stores
Not setOnOff
falseOffOff
trueOnOn

Defaults per command and store, the providers createFlowApiRouter and runAction need, and createCheckpointDurabilityProvider: Runtime configuration. A sequencer's durable option: Sequencer checkpoints. The methods of a DurabilityProvider: Stores.

Errors​

ErrorRaised byCatchableFields
SuspensionErrorctx.suspend() on first reachNo. Rescue handlers do not fire for it. Do not catch it in a block.suspensionId, reason, kind?, title?, data?, resumeSchema?, render?, timeoutMs?, allow
SuspensionTimeoutErrorA user's review or input at its deadlineYes. Uncaught, it fails the request. The block runs again from its top, so work before the call happens again. Finished earlier steps are not run again.suspensionId. Message Suspension <id> timed out.
ErrorRaised byFields
RouteUnavailableErrorA router resume where the selector picks differently (Routers)routerName, recordedRoute, reselectedRoute, recordedRouteDeclared
GeneratorToolUnavailableErrorA generator resume where the paused tool is missing from the resolved tool setdetails.toolName
RecordedValueOmittedErrorA resume of a finished block whose output was over the record limitdetails.blockName, details.bytes

SuspensionRejectedError, raised by a reject, an expired gate or a cancel, is in Errors. RouteUnavailableError, GeneratorToolUnavailableError and RecordedValueOmittedError are fatal, with retryable: false.

A resume that failsResult
Before the request goes in_progress: the record is unreadable, the flow is unregistered, or the checkpoint or replay build throwsThe request stays suspended, the gate pending, so the same resume can be sent again.
After thatA durable failed.
PageWhat it covers
HTTP APIThe resume and answer endpoints, their checks and status codes.
Items and the streamItems across a pause and resuming a stream.
Concurrency policiesWhat a second request on one session does, and a resumed request under each policy.
StoresThe stores that hold requests, checkpoints, suspensions and wakes.
Runtime configurationRetention, sweeper and durability settings.
ErrorsThe shape of an error the client receives.
CLIfsdev run, fsdev chat and fsdev dev.