RunState

Interface: RunState<TInput, TOutput>

Defined in: packages/workflow-core/src/types.ts:513

Persisted run metadata. State is intentionally NOT stored here — it is reconstructed from initialize(input) + log replay on every resume. The store only persists what's needed to route, resume, and audit a run.

Type Parameters

TInput

TInput = unknown

TOutput

TOutput = unknown

Properties

awaiting?

ts
optional awaiting: readonly RunAwaitable[];
optional awaiting: readonly RunAwaitable[];

Defined in: packages/workflow-core/src/types.ts:525

All currently outstanding waits. Current engine versions only create one awaitable at a time, but the persisted shape can represent future fan-out/race primitives without replacing the run schema.


createdAt

ts
createdAt: number;
createdAt: number;

Defined in: packages/workflow-core/src/types.ts:541


error?

ts
optional error: SerializedError;
optional error: SerializedError;

Defined in: packages/workflow-core/src/types.ts:520


input

ts
input: TInput;
input: TInput;

Defined in: packages/workflow-core/src/types.ts:518


output?

ts
optional output: TOutput;
optional output: TOutput;

Defined in: packages/workflow-core/src/types.ts:519


pendingApproval?

ts
optional pendingApproval: object;
optional pendingApproval: object;

Defined in: packages/workflow-core/src/types.ts:534

Set when the run is paused awaiting an approval.

approvalId

ts
approvalId: string;
approvalId: string;

description?

ts
optional description: string;
optional description: string;

meta?

ts
optional meta: WorkflowMetadata;
optional meta: WorkflowMetadata;

stepId?

ts
optional stepId: string;
optional stepId: string;

title

ts
title: string;
title: string;

runId

ts
runId: string;
runId: string;

Defined in: packages/workflow-core/src/types.ts:514


status

ts
status: RunStatus;
status: RunStatus;

Defined in: packages/workflow-core/src/types.ts:515


updatedAt

ts
updatedAt: number;
updatedAt: number;

Defined in: packages/workflow-core/src/types.ts:542


waitingFor?

ts
optional waitingFor: object;
optional waitingFor: object;

Defined in: packages/workflow-core/src/types.ts:527

Set when the run is paused awaiting an external signal.

deadline?

ts
optional deadline: number;
optional deadline: number;

meta?

ts
optional meta: WorkflowMetadata;
optional meta: WorkflowMetadata;

signalName

ts
signalName: string;
signalName: string;

stepId?

ts
optional stepId: string;
optional stepId: string;

workflowId

ts
workflowId: string;
workflowId: string;

Defined in: packages/workflow-core/src/types.ts:516


workflowVersion?

ts
optional workflowVersion: string;
optional workflowVersion: string;

Defined in: packages/workflow-core/src/types.ts:517