RunState
Properties
Section titled “Properties”activeAgentId
Section titled “activeAgentId”activeAgentId: string;activeFlow?
Section titled “activeFlow?”optional activeFlow?: string;activeNode?
Section titled “activeNode?”optional activeNode?: string;createdAt
Section titled “createdAt”createdAt: number;effectKeyVersion?
Section titled “effectKeyVersion?”optional effectKeyVersion?: number;Which effect-key scheme this run’s journal was written under. Version 2 scopes a
flow’s effects by flow@digest; version 1 scoped by flow name only. Before
version 1, callsites were rebased to 0 on every flow entry with no flow in the
key, so a resumed in-flow run would not find its own recorded steps and would
re-execute their side effects. Absent on a run journaled before version 1 —
see assertResumableEffectKeys. Version 1 journals are legacy-resumable.
flowDigest?
Section titled “flowDigest?”optional flowDigest?: string;Canonical digest of the flow this run entered. Stamped on entry, compared on resume. Absent on runs journaled before digest pinning — those resume as they did (classify, don’t break). Integrity metadata: never taken from a caller argument to force a resume.
flowFrame?
Section titled “flowFrame?”optional flowFrame?: PersistedFlowFrame;State owned by the active flow. It is persisted independently from root runtime state.
flowRef?
Section titled “flowRef?”optional flowRef?: RunFlowRef;Store identity of the flow this run entered, when it came from a published version.
flowStack?
Section titled “flowStack?”optional flowStack?: PersistedFlowPark[];Suspended parent flow frames, ordered outermost to innermost.
optional kind?: RunKind;Conversation runs own the chat turn loop (one per session, keyed by sessionId).
Flow runs are one execution of a flow and live under their own key.
Absent on runs persisted before run identity — treated as 'conversation'.
lastExtractedMessageCount?
Section titled “lastExtractedMessageCount?”optional lastExtractedMessageCount?: number;Message count at the last completed extraction; drives the token trigger.
leaseExpiresAt?
Section titled “leaseExpiresAt?”optional leaseExpiresAt?: number;Epoch ms when the execution lease expires. A past expiry is a crashed replica; a missing lease is idle, not stale.
leaseHolder?
Section titled “leaseHolder?”optional leaseHolder?: string;Holder of the execution lease. Taken at run open, renewed on persist points during the turn, cleared at close. Absent means no live executor (idle between turns, or a run that never opened under this scheme).
messages
Section titled “messages”messages: ModelMessage[];pendingInput?
Section titled “pendingInput?”optional pendingInput?: UserContent[];Per-run pending-input FIFO for kind: 'flow'. Conversation runs keep using
the session working-memory buffer; flow runs must not.
processedInboundKeys?
Section titled “processedInboundKeys?”optional processedInboundKeys?: string[];Inbound message idempotency keys already accepted (H2 webhook-retry dedup).
runEpoch?
Section titled “runEpoch?”optional runEpoch?: number;Monotonic logical-run counter. Increments on each fresh turn; stable across suspend/resume. Scopes the durable effect-key namespace so a new turn re-executes rather than replaying a prior turn’s cached result (F6/G8). Absent on legacy runs → treat as 0.
runId: string;sessionId
Section titled “sessionId”sessionId: string;state: Record<string, unknown>;status
Section titled “status”status: "error" | "aborted" | "running" | "paused" | "finished";updatedAt
Section titled “updatedAt”updatedAt: number;verification?
Section titled “verification?”optional verification?: FlowVerificationRecord;Post-run verification of this flow, recorded when the flow reached a terminal
transition that declared gates. Absent when the flow has no gates.
waitingFor?
Section titled “waitingFor?”optional waitingFor?: InterruptRequest;