Skip to content

@oona/vlo / index / SeqStep

Type Alias: SeqStep ​

SeqStep = { activity: ErasedActivity; id?: string; key: string; kind: "step"; mapInput?: (state) => Json; onFailure?: OnFailure; when?: (state) => boolean; } | { activity: ErasedActivity; concurrency: number; key: string; kind: "fan_out"; onFailure?: OnFailure; select: (state) => Json[]; } | { concurrency: number; key: string; kind: "fan_out_runs"; onFailure?: OnFailure; select: (state) => Json[]; workflow: string; } | { context?: Json; key: string; kind: "wait_for"; onTimeout?: OnTimeout; signal: SignalDef<Json>; timeoutMs?: number; } | { kind: "sleep"; ms: number; }

Defined in: sdk/ts/sdk/src/core/helpers/sequence-types.ts:97

One phase of a sequence, as built by step, fanOut, fanOutRuns, waitFor or sleep. Treat it as opaque; the shape is exposed for inspection only.

Union Members ​

Type Literal ​

{ activity: ErasedActivity; id?: string; key: string; kind: "step"; mapInput?: (state) => Json; onFailure?: OnFailure; when?: (state) => boolean; }

activity ​

readonly activity: ErasedActivity

The activity to run.

id? ​

readonly optional id?: string

Explicit step id; absent means kernel-derived.

key ​

readonly key: string

Key in results: the activity name.

kind ​

readonly kind: "step"

A single task.

mapInput? ​

readonly optional mapInput?: (state) => Json

Builds the task input from state; absent means "the previous phase's value".

Parameters ​
state ​

SeqState

Returns ​

Json

onFailure? ​

readonly optional onFailure?: OnFailure

What a task that did not succeed does; absent means "fail".

when? ​

readonly optional when?: (state) => boolean

Gate evaluated on phase entry; absent means always run.

Parameters ​
state ​

SeqState

Returns ​

boolean


Type Literal ​

{ activity: ErasedActivity; concurrency: number; key: string; kind: "fan_out"; onFailure?: OnFailure; select: (state) => Json[]; }

activity ​

readonly activity: ErasedActivity

The activity to run per item.

concurrency ​

readonly concurrency: number

Maximum tasks in flight at once.

key ​

readonly key: string

Key in results: the activity name.

kind ​

readonly kind: "fan_out"

One task per selected item.

onFailure? ​

readonly optional onFailure?: OnFailure

What a task that did not succeed does; absent means "fail".

select ​

readonly select: (state) => Json[]

Pure selector of the items; re-evaluated on every event of the phase.

Parameters ​
state ​

SeqState

Returns ​

Json[]


Type Literal ​

{ concurrency: number; key: string; kind: "fan_out_runs"; onFailure?: OnFailure; select: (state) => Json[]; workflow: string; }

concurrency ​

readonly concurrency: number

Maximum child runs in flight at once.

key ​

readonly key: string

Key in results: the workflow name.

kind ​

readonly kind: "fan_out_runs"

One child run per selected item.

onFailure? ​

readonly optional onFailure?: OnFailure

What a child that did not complete does; absent means "fail".

select ​

readonly select: (state) => Json[]

Pure selector of the child inputs; re-evaluated on every event of the phase.

Parameters ​
state ​

SeqState

Returns ​

Json[]

workflow ​

readonly workflow: string

The workflow to spawn per item.


Type Literal ​

{ context?: Json; key: string; kind: "wait_for"; onTimeout?: OnTimeout; signal: SignalDef<Json>; timeoutMs?: number; }

context? ​

readonly optional context?: Json

Emitted on the human channel when the wait opens.

key ​

readonly key: string

Key in signals: the signal name.

kind ​

readonly kind: "wait_for"

A parked wait for a signal.

onTimeout? ​

readonly optional onTimeout?: OnTimeout

What the deadline does; absent means "fail".

signal ​

readonly signal: SignalDef<Json>

The signal to wait for.

timeoutMs? ​

readonly optional timeoutMs?: number

Deadline in milliseconds; absent means wait forever.


Type Literal ​

{ kind: "sleep"; ms: number; }

kind ​

readonly kind: "sleep"

A timer that stores nothing.

ms ​

readonly ms: number

Duration in milliseconds.