Restate Typescript SDK
    Preparing search index...

    Policy controlling automatic retries of ambiguous ingress failures.

    Retries are opt-in: they happen only when a policy is configured (see ConnectionOpts.retry) and the call carries an idempotencyKey (see IngressCallOptions.idempotencyKey). Retrying without a key could double-execute a non-idempotent invocation, so the idempotency key is the safety boundary that a policy can never bypass.

    By default the following failures are retried: network errors (the underlying fetch rejecting), HTTP 429, and HTTP 5xx responses. Override this with RetryPolicy.shouldRetry.

    interface RetryPolicy {
        exponentiationFactor?: number;
        initialInterval?: number | Duration;
        maxAttempts?: number;
        maxInterval?: number | Duration;
        shouldRetry?: (failure: RetryFailure, attempt: number) => boolean;
    }
    Index

    Properties

    exponentiationFactor?: number

    Exponentiation factor to use when computing the next retry delay. Defaults to 2.

    initialInterval?: number | Duration

    Initial backoff interval. If a number is provided, it is interpreted as milliseconds. Defaults to 100 milliseconds.

    maxAttempts?: number

    Max number of attempts (including the initial), before giving up.

    Defaults to 6 (the initial attempt plus up to 5 retries).

    maxInterval?: number | Duration

    Maximum backoff interval. If a number is provided, it is interpreted as milliseconds. Defaults to 2000 milliseconds.

    shouldRetry?: (failure: RetryFailure, attempt: number) => boolean

    Decide whether a given failure should be retried. When provided, this fully replaces the built-in rule (network / 429 / 5xx).

    The idempotency-key gate and the maxAttempts cap still apply — this predicate only narrows or broadens which failures are retryable within those bounds. Compose with the built-in rule via the exported defaultShouldRetry.

    Type Declaration

      • (failure: RetryFailure, attempt: number): boolean
      • Parameters

        • failure: RetryFailure

          the failure being considered

        • attempt: number

          the zero-based index of the attempt that just failed

        Returns boolean