Skip to content

Step API Reference

This page details the configuration and result structures for individual steps.

StepOptions<TInput>

Configuration object provided to the .step() method.

PropertyTypeDescription
retriesnumberNumber of retry attempts.
retryDelayMsnumberInitial delay between retries in milliseconds.
backoffFactor'fixed' | 'linear' | 'exponential'Strategy to increase retry delay.
timeoutMsnumberMaximum execution time for the step.
jitterbooleanWhether to add randomness to retry delays.
maxRetryDelayMsnumberCap for the retry delay.
compensate(ctx) => void | Promise<void>Function to undo this step's side effects.

StepResult

Object returned as part of the FlowResult containing the outcome of a step.

ts
type StepResult = {
  name: string;
  status: 'pending' | 'running' | 'completed' | 'failed' | 'cancelled';
  attempts: number;
  durationMs: number;
  error?: unknown;
};

ParallelOptions

Options for parallel execution blocks.

PropertyTypeDescription
failFastbooleanIf true, the whole block fails as soon as one step fails.

Released under the MIT License.