durable-execution-sdk-js.retrystrategyconfig.md

December 2, 2025 ยท View on GitHub

Home > @aws/durable-execution-sdk-js > RetryStrategyConfig

RetryStrategyConfig interface

Configuration options for creating a retry strategy

Signature:

interface RetryStrategyConfig

Remarks

When neither retryableErrors nor retryableErrorTypes is specified, all errors are retried by default. When either is specified, only errors matching the specified criteria are retried. When both are specified, errors matching either criteria are retried (OR logic).

Example

// Retry all errors (default behavior)
createRetryStrategy({ maxAttempts: 5 });

// Retry only specific error types
createRetryStrategy({ retryableErrorTypes: [TimeoutError, NetworkError] });

// Retry only errors matching message patterns
createRetryStrategy({ retryableErrors: [/timeout/i, /connection/i] });

// Retry errors matching either type OR pattern
createRetryStrategy({
  retryableErrorTypes: [TimeoutError],
  retryableErrors: [/network/i],
});

Properties

Property

Modifiers

Type

Description

backoffRate?

number

(Optional) Multiplier for exponential backoff on each retry.

initialDelay?

Duration

(Optional) Initial delay before first retry.

jitter?

JitterStrategy

(Optional) Jitter strategy to apply to retry delays.

maxAttempts?

number

(Optional) Maximum number of total attempts (including initial attempt).

maxDelay?

Duration

(Optional) Maximum delay between retries.

retryableErrors?

(string | RegExp)[]

(Optional) List of error message patterns (strings or RegExp) that are retryable.

retryableErrorTypes?

(new () => Error)[]

(Optional) List of error class types that are retryable.