Skip to content

@saflib/workflows


Function: step() ​

step<C, M>>(machine, input, options): WorkflowStep<C, M>>

Helper function for defining a step in a workflow, enforcing types properly.

Type Parameters ​

Type Parameter
C
M extends AnyStateMachine

Parameters ​

ParameterType
machineM
input(arg) => InputFrom<M>
options{ commitAfter?: { message: string | (arg) => string; }; skipIf?: (arg) => boolean; validate?: (arg) => Promise<undefined | string>; }
options.commitAfter?{ message: string | (arg) => string; }
options.commitAfter.messagestring | (arg) => string
options.skipIf?(arg) => boolean
options.validate?(arg) => Promise<undefined | string>

Returns ​

WorkflowStep<C, M>