Skip to main content

Set Steps to Automatically Retry: Enhancing Workflow Reliability in Torq

Learn how to set steps to automatically retry, saving you the effort of implementing complex retry patterns.

Configure steps to automatically retry on failure or based on a condition, helping your workflows recover gracefully from transient errors or rate-limited API calls.

  1. Open Execution Options: Click on the step and navigate to the Execution Options tab.

  2. Set the retry type: Select one of the following from the Retry after option:

    • After step failure: Retries the step if the call or action returns a failure status.

    • Retry on condition: Retries the step if a specified condition is met, or until the maximum number of attempts is reached. One condition can be set per step.

  3. Set the delay and attempts: Enter the number of retry attempts and the delay in seconds between each attempt.

Delay and backoff behavior

Torq applies an exponential backoff factor of 1.25 by default, increasing the wait time between each retry attempt (for example, 1 second > 2 seconds > 4 seconds). This helps avoid retry collisions and prevents overwhelming external systems.

Backoff behavior varies based on the initial delay:

  • Initial delay of 1 second: Backoff increases until the delay reaches 1 minute, then remains at 1 minute.

  • Initial delay of 1 minute: Backoff increases until the delay reaches 1 hour, then remains at 1 hour.

  • Initial delay greater than 1 hour: No exponential backoff is applied.

If the cumulative delay time (with 25% backoff) does not exceed 31 days, the step continues to retry for the full duration. Workflows waiting between retries are placed in On hold status and do not consume your workflow execution quota.

There is no notification when a step is being retried. The workflow may remain on hold for up to 31 days if the maximum retry duration is configured.

Edit retry settings in YAML

Retry settings can also be modified directly in the step's YAML:

retry:
type: 1
delay: 10
max_retries: 30

To remove exponential backoff and use retries as a self-contained loop, set the factor to 1:

retry:
factor: 1

Step failure after retries

If all retry attempts are exhausted and the step still fails or the condition is not met, the workflow behavior is determined by the Ignore failure setting, the workflow either fails or continues depending on your configuration.

Parallel execution

Steps running in parallel will not advance until all parallel steps have finished retrying. If one step continuously fails or does not meet its condition, all parallel steps wait until that step's retry attempts are exhausted.

Did this answer your question?