Skip to content

Retries API Reference

Details on how retries are calculated and configured.

Retry Options

These are part of StepOptions.

retries

The number of times a step will be re-executed after an error. Set to 0 (default) to disable retries.

retryDelayMs

The base delay in milliseconds.

backoffFactor

Defines how retryDelayMs changes over attempts:

  • 'fixed': delay = retryDelayMs
  • 'linear': delay = retryDelayMs * attempt
  • 'exponential': delay = retryDelayMs * (2 ^ (attempt - 1))

Note: attempt starts at 1 for the first retry.

maxRetryDelayMs

Caps the maximum delay calculated by the backoff factor.

jitter

If true, adds a random variation (0.8x to 1.2x) to the calculated delay to prevent synchronized retries.

Released under the MIT License.