Skip to content

remora-monorepo


remora-monorepo / lib / WorkflowExecutionStateChannel

Interface: WorkflowExecutionStateChannel

Defined in: packages/core/src/executor/channel.ts:16

Pub/sub channel for streaming ExecutionState snapshots from an executor to one or more consumers.

Methods

close()

close(): void

Defined in: packages/core/src/executor/channel.ts:20

Signal that no more states will be published. Subscribers will drain and terminate.

Returns

void


latest()?

optional latest(): Promise<{ completedAt?: string; durationMs?: number; error?: { category: string; code: string; isRetryable?: boolean; message: string; statusCode?: number; stepId?: string; }; output?: unknown; runId: string; startedAt: string; status: "pending" | "running" | "completed" | "failed"; stepRecords: object[]; workflowHash?: string; } | null>

Defined in: packages/core/src/executor/channel.ts:29

Returns the most recent state, or null if none has been published.

Returns

Promise<{ completedAt?: string; durationMs?: number; error?: { category: string; code: string; isRetryable?: boolean; message: string; statusCode?: number; stepId?: string; }; output?: unknown; runId: string; startedAt: string; status: "pending" | "running" | "completed" | "failed"; stepRecords: object[]; workflowHash?: string; } | null>


publish()

publish(state): void

Defined in: packages/core/src/executor/channel.ts:18

Push a new state snapshot into the channel.

Parameters

state
completedAt?

string = "string"

durationMs?

number = "number"

error?

{ category: string; code: string; isRetryable?: boolean; message: string; statusCode?: number; stepId?: string; } = errorSnapshotSchema

error.category

string = "string"

error.code

string = "string"

error.isRetryable?

boolean = "boolean"

error.message

string = "string"

error.statusCode?

number = "number"

error.stepId?

string = "string"

output?

unknown = "unknown"

runId

string = "string"

startedAt

string = "string"

status

"pending" | "running" | "completed" | "failed" = runStatusSchema

stepRecords

object[] = ...

workflowHash?

string = "string"

Returns

void


subscribe()

subscribe(opts?): AsyncIterable<{ completedAt?: string; durationMs?: number; error?: { category: string; code: string; isRetryable?: boolean; message: string; statusCode?: number; stepId?: string; }; output?: unknown; runId: string; startedAt: string; status: "pending" | "running" | "completed" | "failed"; stepRecords: object[]; workflowHash?: string; }>

Defined in: packages/core/src/executor/channel.ts:27

Subscribe to state updates.

  • Default (replay: false): yields the latest state immediately (if any), then follows live.
  • replay: true: yields the full history from the beginning, then follows live.

Parameters

opts?
replay?

boolean

Returns

AsyncIterable<{ completedAt?: string; durationMs?: number; error?: { category: string; code: string; isRetryable?: boolean; message: string; statusCode?: number; stepId?: string; }; output?: unknown; runId: string; startedAt: string; status: "pending" | "running" | "completed" | "failed"; stepRecords: object[]; workflowHash?: string; }>