Skip to main content

Retry & Error Handling

Workflows support configurable retries for failed steps and expose per-step results. Use retryPolicy to make pipelines resilient to transient failures.

retryPolicy Config

number
required
Maximum retry attempts per step before marking it as failed.
number
required
Base delay in milliseconds between retries. Uses exponential backoff (backoffMs * 2^attempt).

Example

Retries apply when a step throws an error. The step is re-run up to maxRetries times with exponential backoff between attempts.

StepResult Status

Each step produces a StepResult with a status:
string
Name of the step.
'done' | 'error' | 'skipped'
Outcome of the step.
string
Error message when status is error.
number
Time taken for the step in milliseconds.

WorkflowResult

The workflow returns a WorkflowResult containing final state and step results:
TState
Final state after all steps. Includes updates from successful steps; failed steps may leave partial updates.
StepResult[]
One entry per step. Use to check which steps succeeded, failed, or were skipped.

Example: Handling Results


Full Example with Retry