Retry allows new retries of steps defined in a subpipeline to be executed.

Take a look at the configuration parameters of the component:

  • Maximum Number of Retries: the first retry also counts, so if the step fails in the first execution and you want a new retry to be made, the value of this parameter should be 2.

  • Timeout Of The Whole Retry Operation: maximum length of each retry, including the first one (in milliseconds).

  • Fail On Error: if the option is activated, the Retry execution that reaches the maximum number of tries or the maximum length will end with an error and will be interrupted; otherwise, the pipeline execution continues, but the result of the last try will be delivered to the next component.

Messages flow

Input

Any structure is accepted.

Output

The output message of the last processed step.

Defining the subpipeline to be executed on each new retry

To work with this type of component, it's important to consider:

  • Subpipeline defined in "onProcess": subpipeline to be executed on each new retry.

  • Subpipeline defined in "onException": subpipeline to be executed after an unsuccessful retry.

Click here to better understand how subpipelines work.

IMPORTANT: on each new retry, the first step on the subpipeline defined in onProcess receives the output message from the last processed step. Therefore, data to be reused on new retries must be correctly handled to be accessible during the new retries (e.g.: the data manipulation through the Session component).

Informing success to a Retry block execution

The Retry component expects a "success" property with the true value to be informed in the last step of the subpipeline for the execution to be considered successful. If an error occurs or the “success” property is informed with a false value or doesn’t even exist, Retry will understand that a new retry must be executed.

Handling Errors

When an error occurs during the processing of the subpipeline in onProcess, the subpipeline defined in onException will be invoked, if it's defined.

In onException, it's possible to:

  • have access to the details of the error that occurred during the processing of the last retry.

  • define if the Retry component continues with the retries, informing a “success” property with the false value. If a “success” property is specified with the true value, then Retry will be successfully finished and no other retry will be executed.

Use scenarios of the Retry component with errors handling

Enabled "Fail on Error" property and no subpipeline defined in onException

  • the pipeline will be interrupted after all the retries

  • an error will be thrown from the Retry component

  • no other component will be invoked after the Retry

Enabled "Fail on Error" property and a subpipeline defined in onException

  • the pipeline will be interrupted after all the retries

  • the subpipeline defined in onException will be executed after every new retry

  • an error will be thrown from the Retry component

  • no other component will be invoked after the Retry

Disabled "Fail on Error" property and no subpipeline defined in onException

  • the pipeline will not be interrupted after all the retries

  • no error will be thrown from the Retry component

  • the next component will be invoked receiving the output message from the Retry

Disabled "Fail on Error" property and a subpipeline defined in onException

  • the pipeline will not be interrupted after all the retries

  • the subpipeline defined in onException will be executed after every new retry

  • no error will be thrown from the Retry component

  • the next component will be invoked receiving the output message from the Retry

IMPORTANT: if an error component, such as Throw Error or Assert, is used on the subpipeline in onProcess or if an error occurs, then Retry will be finished and the error will be propagated to the pipeline. Besides, whenever the "success" property is defined with the true value on the last step of the subpipeline in onException, the Retry execution will be finished, even if the Fail on Error property is activated.

Did this answer your question?