interface RetryProps
This page is available in another version. Click here for the v2 documentation.
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.StepFunctions.RetryProps |
![]() | software.amazon.awscdk.services.stepfunctions.RetryProps |
![]() | aws_cdk.aws_stepfunctions.RetryProps |
![]() | @aws-cdk/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
Name | Type | Description |
---|---|---|
backoff | number | Multiplication for how much longer the wait interval gets on every retry. |
errors? | string[] | Errors to retry. |
interval? | Duration | How many seconds to wait initially before retrying. |
max | number | How 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).