Execution Options
The third argument to .execute() is an optional options object.
const result = await flow.execute(input, deps, options);Options
Section titled “Options”timeout
Section titled “timeout”Type: number
Maximum duration for the entire flow in milliseconds. Throws TimeoutError if exceeded.
stepTimeout
Section titled “stepTimeout”Type: number
Default maximum duration per step in milliseconds. Can be overridden per-step via .withRetry({ stepTimeout }).
signal
Section titled “signal”Type: AbortSignal
External abort signal for cancellation. Combined with flow/step timeouts into ctx.signal.
const controller = new AbortController();await flow.execute(input, deps, { signal: controller.signal });observer
Section titled “observer”Type: FlowObserver
Lifecycle hooks for logging, metrics, or tracing. See Observability guide.
throwOnError
Section titled “throwOnError”Type: boolean
Default: true
When false, returns partial accumulated state instead of throwing on step failure.
correlationId
Section titled “correlationId”Type: string
Custom ID propagated to events and observers via ctx.meta.correlationId. Auto-generated if not provided.
errorHandling
Section titled “errorHandling”Type: object
Control behavior for missing optional dependencies.
{ errorHandling: { throwOnMissingDatabase: false, // warn instead of throwing throwOnMissingEventPublisher: false, // warn instead of throwing }}