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
readonlyactivity:ErasedActivity
The activity to run.
id?
readonlyoptionalid?:string
Explicit step id; absent means kernel-derived.
key
readonlykey:string
Key in results: the activity name.
kind
readonlykind:"step"
A single task.
mapInput?
readonlyoptionalmapInput?: (state) =>Json
Builds the task input from state; absent means "the previous phase's value".
Parameters
state
Returns
onFailure?
readonlyoptionalonFailure?:OnFailure
What a task that did not succeed does; absent means "fail".
when?
readonlyoptionalwhen?: (state) =>boolean
Gate evaluated on phase entry; absent means always run.
Parameters
state
Returns
boolean
Type Literal
{ activity: ErasedActivity; concurrency: number; key: string; kind: "fan_out"; onFailure?: OnFailure; select: (state) => Json[]; }
activity
readonlyactivity:ErasedActivity
The activity to run per item.
concurrency
readonlyconcurrency:number
Maximum tasks in flight at once.
key
readonlykey:string
Key in results: the activity name.
kind
readonlykind:"fan_out"
One task per selected item.
onFailure?
readonlyoptionalonFailure?:OnFailure
What a task that did not succeed does; absent means "fail".
select
readonlyselect: (state) =>Json[]
Pure selector of the items; re-evaluated on every event of the phase.
Parameters
state
Returns
Json[]
Type Literal
{ concurrency: number; key: string; kind: "fan_out_runs"; onFailure?: OnFailure; select: (state) => Json[]; workflow: string; }
concurrency
readonlyconcurrency:number
Maximum child runs in flight at once.
key
readonlykey:string
Key in results: the workflow name.
kind
readonlykind:"fan_out_runs"
One child run per selected item.
onFailure?
readonlyoptionalonFailure?:OnFailure
What a child that did not complete does; absent means "fail".
select
readonlyselect: (state) =>Json[]
Pure selector of the child inputs; re-evaluated on every event of the phase.
Parameters
state
Returns
Json[]
workflow
readonlyworkflow:string
The workflow to spawn per item.
Type Literal
{ context?: Json; key: string; kind: "wait_for"; onTimeout?: OnTimeout; signal: SignalDef<Json>; timeoutMs?: number; }
context?
readonlyoptionalcontext?:Json
Emitted on the human channel when the wait opens.
key
readonlykey:string
Key in signals: the signal name.
kind
readonlykind:"wait_for"
A parked wait for a signal.
onTimeout?
readonlyoptionalonTimeout?:OnTimeout
What the deadline does; absent means "fail".
signal
The signal to wait for.
timeoutMs?
readonlyoptionaltimeoutMs?:number
Deadline in milliseconds; absent means wait forever.
Type Literal
{ kind: "sleep"; ms: number; }
kind
readonlykind:"sleep"
A timer that stores nothing.
ms
readonlyms:number
Duration in milliseconds.