# RetryProps

Retry details.

- Source: [`aws-stepfunctions/lib/types.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-stepfunctions/lib/types.ts#L111)
- Type last changed: v2.95.0 · 7 Sep 2023

## Example

```ts
const parallel = new sfn.Parallel(this, 'Do the work in parallel');

// Add branches to be executed in parallel
const shipItem = new sfn.Pass(this, 'ShipItem');
const sendInvoice = new sfn.Pass(this, 'SendInvoice');
const restock = new sfn.Pass(this, 'Restock');
parallel.branch(shipItem);
parallel.branch(sendInvoice);
parallel.branch(restock);

// Retry the whole workflow if something goes wrong with exponential backoff
parallel.addRetry({
  maxAttempts: 1,
  maxDelay: Duration.seconds(5),
  jitterStrategy: sfn.JitterType.FULL,
});

// How to recover from errors
const sendFailureNotification = new sfn.Pass(this, 'SendFailureNotification');
parallel.addCatch(sendFailureNotification);

// What to do in case everything succeeded
const closeOrder = new sfn.Pass(this, 'CloseOrder');
parallel.next(closeOrder);
```

## Properties

- `backoffRate`: number = 2 — Multiplication for how much longer the wait interval gets on every retry.

- `errors`: string[] — Errors to retry.

  **Default:** All errors

  A list of error strings to retry, which can be either predefined errors
  (for example Errors.NoChoiceMatched) or a self-defined error.

- `interval`: [Duration](/cdk/api/v2/docs/aws-cdk-lib.Duration.html) = Duration.seconds(1) — How many seconds to wait initially before retrying.

- `jitterStrategy`: [JitterType](/cdk/api/v2/docs/aws-cdk-lib.aws_stepfunctions.JitterType.html) — Introduces a randomization over the retry interval.

  **Default:** No jitter strategy

- `maxAttempts`: number = 3 — How many times to retry this particular error.

  May be 0 to disable retry for specific errors (in case you have
  a catch-all retry policy).

- `maxDelay`: [Duration](/cdk/api/v2/docs/aws-cdk-lib.Duration.html) — Maximum limit on retry interval growth during exponential backoff.

  **Default:** No max delay
