OptionalexponentiationExponentiation factor to use when computing the next retry delay.
Defaults to 2.
OptionalinitialInitial backoff interval. If a number is provided, it is interpreted as
milliseconds. Defaults to 250 milliseconds.
OptionalmaxMax number of attempts (including the initial), before giving up.
Retrying stops as soon as either maxDuration or maxAttempts is reached.
Defaults to 6 (the initial attempt plus up to 5 retries). Pass false to
remove the attempt bound.
OptionalmaxMax total duration of retries, measured from the first attempt, before giving up. If a number is provided, it is interpreted as milliseconds.
This bound is checked only when deciding whether to start another attempt after a failure: it never aborts an in-flight request.
Retrying stops as soon as either maxDuration or maxAttempts is reached.
Defaults to 60 seconds. Pass false to remove the duration bound.
OptionalmaxMaximum backoff interval. If a number is provided, it is interpreted as
milliseconds. Defaults to 3000 milliseconds.
OptionalrespectWhether to honor a Retry-After response header when the server provides
one. When true (the default), a Retry-After value overrides the computed
exponential backoff for that attempt.
Set to false to always use the exponential backoff and ignore the header.
Note that Retry-After never extends the number of retries: maxAttempts and
maxDuration is always respected regardless of this setting.
Defaults to true.
OptionalshouldDecide whether a given failure should be retried. When provided, this
fully replaces the built-in rule (network / transient 408/425/429/5xx,
excluding invocation-sourced errors).
The idempotency-key gate still applies to regular invocations; workflow
submissions, attaches, and output retrieval remain eligible without an
idempotency key. The maxAttempts cap applies to all of them. This predicate
only narrows or broadens which failures are retryable within those bounds.
Compose with the built-in rule via the exported defaultShouldRetry.
the failure being considered
the zero-based index of the attempt that just failed
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 request is safe to repeat. Regular calls require an
idempotencyKey(see IngressCallOptions.idempotencyKey); workflow submissions are idempotent by workflow ID, while workflow attaches and output retrieval only observe the existing workflow.By default the following failures are retried: network errors (the underlying
fetchrejecting) and responses with a transient status (408,425,429, or5xx). A terminal error of the invocation is never retried, whatever its status code. Override all of this with RetryPolicy.shouldRetry.