aws-cdk-lib.aws_stepfunctions.RetryProps

interface RetryProps

LanguageType name
.NETAmazon.CDK.AWS.StepFunctions.RetryProps
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awsstepfunctions#RetryProps
Javasoftware.amazon.awscdk.services.stepfunctions.RetryProps
Pythonaws_cdk.aws_stepfunctions.RetryProps
TypeScript (source)aws-cdk-lib » aws_stepfunctions » RetryProps

Retry details.

Example

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
parallel.addRetry({ maxAttempts: 1 });

// 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

NameTypeDescription
backoffRate?numberMultiplication for how much longer the wait interval gets on every retry.
errors?string[]Errors to retry.
interval?DurationHow many seconds to wait initially before retrying.
maxAttempts?numberHow many times to retry this particular error.

backoffRate?

Type: number (optional, default: 2)

Multiplication for how much longer the wait interval gets on every retry.


errors?

Type: string[] (optional, default: All errors)

Errors to retry.

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


interval?

Type: Duration (optional, default: Duration.seconds(1))

How many seconds to wait initially before retrying.


maxAttempts?

Type: number (optional, default: 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).