RetryProps

class aws_cdk.aws_stepfunctions.RetryProps(*, backoff_rate=None, errors=None, interval=None, max_attempts=None)

Bases: object

Retry details.

Parameters
  • backoff_rate (Union[int, float, None]) – Multiplication for how much longer the wait interval gets on every retry. Default: 2

  • errors (Optional[Sequence[str]]) – 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. Default: All errors

  • interval (Optional[Duration]) – How many seconds to wait initially before retrying. Default: Duration.seconds(1)

  • max_attempts (Union[int, float, None]) – 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). Default: 3

Example:

parallel = sfn.Parallel(self, "Do the work in parallel")

# Add branches to be executed in parallel
ship_item = sfn.Pass(self, "ShipItem")
send_invoice = sfn.Pass(self, "SendInvoice")
restock = sfn.Pass(self, "Restock")
parallel.branch(ship_item)
parallel.branch(send_invoice)
parallel.branch(restock)

# Retry the whole workflow if something goes wrong
parallel.add_retry(max_attempts=1)

# How to recover from errors
send_failure_notification = sfn.Pass(self, "SendFailureNotification")
parallel.add_catch(send_failure_notification)

# What to do in case everything succeeded
close_order = sfn.Pass(self, "CloseOrder")
parallel.next(close_order)

Attributes

backoff_rate

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

Default

2

Return type

Union[int, float, None]

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.

Default

All errors

Return type

Optional[List[str]]

interval

How many seconds to wait initially before retrying.

Default

Duration.seconds(1)

Return type

Optional[Duration]

max_attempts

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).

Default

3

Return type

Union[int, float, None]