Skip to main content

Retries

Using retries it is possible to define fault-tolerant automations.

Use Cases

Use retries

  • When certain parts of your automation occasionally fail and the failure is temporary.
  • To poll a system until it reaches a certain status.

Concept

The retry feature is implemented as a Wrapper.

Importing the Base functionality project will provide you with a wrapper called retry.

When the retry wrapper is attached to a connector, it will monitor the execution status of the connection and restart the execution in case an error occurs.

As all wrappers, the retry wrapper can be statically attached and configured. Please refer to Static Wrappers for more information.

Alternatively, the retry wrapper can be dynamically attached and configured. Please refer to Dynamic Wrappers for more information.

info

The most common usage is to dynamically attach and configure the retry wrapper to a connector. This way the configuration of the retries is individual to the particular use of the connector.

info

The retry wrapper provided by Cloudomation is considered an example which can be extended or modified to your needs.

Parameters

The retry wrapper accepts the following parameters:

NameTypeDescriptionRequiredDefault value
max_triesintMaximum number of tries before failing.no3
delay_secintNumber of seconds to wait between tries.no10
timeout_secintA timeout across all tries. Specify 0 to disable the timeout.no0
archive_retriesbooleanIf executions of previous tries should be archived.noTrue

Examples

example

Using a connection with retries

import flow_api

def handler(system: flow_api.System, this: flow_api.Execution):
# We want to try to connect to <name-of-a-connector>.
# There are a maximum of 10 attempts. If an attempt fails,
# we'll wait 30 seconds until retrying.
this.using(
'retry',
max_tries=10,
delay_sec=30,
).connect('<name-of-a-connector>')
return this.success('all done')

Learn more

Wrappers
Import / Export and Upload
Base functionality