Function: step()
step<
I,O>(target,mapInput?,options?):SeqStep
Defined in: sdk/ts/sdk/src/core/helpers/sequence.ts:72
A sequence phase that runs target once.
Without mapInput the task input is the run's start input for phase 0 and the previous phase's stored value afterwards (sleeps are skipped). The output is stored in results[target.name]. A task that does not succeed fails the run, unless onFailure: "continue" stores null instead; when returning false also stores null and skips the task. id pins the step id for handlers that key on it.
Type Parameters
I
I
O
O
Parameters
target
Activity<I, O>
mapInput?
(state) => I
options?
StepOptions = {}
Returns
Example
ts
import { defineWorkflow, resultOf, sequence, step } from "@oona/vlo";
import { finish, notify, plan } from "./activities.ts";
export default defineWorkflow("example", sequence([
step(plan),
step(finish, (state) => ({ uppers: resultOf(state, plan).items, approvedBy: "auto" })),
step(notify, undefined, { onFailure: "continue", when: (s) => resultOf(s, plan).items.length > 0 }),
]));