Skip to content

RunState

activeAgentId: string;

optional activeFlow?: string;

optional activeNode?: string;

createdAt: number;

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.


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.


optional flowFrame?: PersistedFlowFrame;

State owned by the active flow. It is persisted independently from root runtime state.


optional flowRef?: RunFlowRef;

Store identity of the flow this run entered, when it came from a published version.


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'.


optional lastExtractedMessageCount?: number;

Message count at the last completed extraction; drives the token trigger.


optional leaseExpiresAt?: number;

Epoch ms when the execution lease expires. A past expiry is a crashed replica; a missing lease is idle, not stale.


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: ModelMessage[];

optional pendingInput?: UserContent[];

Per-run pending-input FIFO for kind: 'flow'. Conversation runs keep using the session working-memory buffer; flow runs must not.


optional processedInboundKeys?: string[];

Inbound message idempotency keys already accepted (H2 webhook-retry dedup).


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: string;

state: Record<string, unknown>;

status: "error" | "aborted" | "running" | "paused" | "finished";

updatedAt: number;

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.


optional waitingFor?: InterruptRequest;