Retry

Overview

The Retry action automatically retries a failed workflow step multiple times before marking it as failed. It's essential for handling transient failures and building resilient test workflows.

circle-info

🔄 Purpose

Use Retry to:

  • Handle transient network failures

  • Account for eventual consistency

  • Overcome flaky tests

  • Build resilient workflows

  • Reduce false negatives


When to Use Retry

✅ Good Use Cases

Scenario
Reason

Network Timeouts

Temporary connectivity issues

Flaky Tests

Tests that occasionally fail randomly

API Rate Limits

Server temporarily unavailable

Resource Contention

Temporary database locks

Eventual Consistency

Data not immediately available

Load-Dependent Failures

Failures under high system load

❌ Anti-Patterns (Don't Do)

  • ❌ Retry permanent errors (404, 401, 403)

  • ❌ Retry without delays (hammers the server)

  • ❌ Excessive retry attempts (30+ retries)

  • ❌ Retry as error handling (not a substitute)

  • ❌ No logging of retries (can't debug)


Configuration

Basic Setup

  1. Open your workflow

  2. Click "Add Action" → Select "Retry"

  3. Configure retry settings:

    • Max Attempts: Number of times to retry (1-10)

    • Initial Delay: Wait time before first retry

    • Backoff Strategy: Linear, Exponential, or Fixed

    • Max Delay: Maximum wait between retries

  4. Optional: Specify error types to retry on

  5. Save and connect to workflow

Configuration Options


Backoff Strategies

Linear Backoff

Delay increases by constant amount:

Use when: Steady, predictable wait is needed

Exponential Backoff

Delay doubles each time:

Use when: System may need increasing time to recover

Fixed Backoff

Same delay each retry:

Use when: Consistent, simple retry needed


Configuration Examples

Conservative (Safe for Production)

Aggressive (Fast Feedback)

Moderate (Balanced)


Practical Examples

Example 1: API Retry with Exponential Backoff

Example 2: Database Query Retry

Example 3: Rate-Limited API


Retry Strategies

Strategy 1: Quick Retry for Network

For transient network failures:

Strategy 2: Patient Retry for Async

For operations with high variance:

Strategy 3: Selective Retry

Only retry specific errors:


Combining Retry with Other Actions

Retry + Wait

Add guaranteed delay:

Retry + Condition

Retry only on specific conditions:

Retry + Send Email

Alert after retries exhausted:


Best Practices

✅ Do

  • Start conservative - Begin with 3 attempts, increase if needed

  • Use exponential backoff - Better for most scenarios

  • Set max delay - Prevent excessively long waits

  • Log retry attempts - Track for debugging

  • Test retry configuration - Simulate failures to verify

  • Monitor retry metrics - Track how often retries succeed

  • Document retry decisions - Explain why specific config chosen

❌ Don't

  • Retry permanent errors - Won't help with 404, 401, etc.

  • Use excessive attempts - 30 retries is overkill

  • Retry without delay - Hammers server, wastes resources

  • Ignore error types - Be selective about what to retry

  • Forget to test - Validate configuration before production

  • Set delays too high - Use reasonable timeouts

  • Retry data-modifying operations - Risk duplicates/inconsistency


Performance Considerations

Worst Case Scenarios

Best Case Scenarios

Calculation Template


Troubleshooting

Issue: Retry succeeds but takes too long

Solution:

  1. Reduce max attempts

  2. Decrease initial delay

  3. Use Fixed backoff instead of Exponential

  4. Lower max delay cap

  5. Investigate root cause of failures

Issue: Retry doesn't help, still fails

Symptoms:

  • All retry attempts fail

  • Same error every time

  • Permanent failure (not transient)

Causes:

  • Error is permanent (404, 401)

  • System is down (not just slow)

  • Wrong configuration

Solutions:

  1. Check error type (is it truly transient?)

  2. Verify system is operational

  3. Consider if retry is appropriate

  4. Switch to manual intervention

Issue: Retry succeeds inconsistently

Solution:

  1. Increase retry attempts

  2. Use more aggressive backoff

  3. Increase max delay

  4. Add initial Wait before first attempt

  5. Investigate actual failure cause


Error Types to Retry

Transient Errors (Retry These)

Error
HTTP
Example

Timeout

408

Connection timed out

Service Unavailable

503

Server temporarily down

Rate Limited

429

Too many requests

Connection Reset

N/A

Network connection lost

Temporarily Unavailable

503

Maintenance or load

Permanent Errors (Don't Retry)

Error
HTTP
Reason

Not Found

404

Resource doesn't exist

Unauthorized

401

Authentication failed

Forbidden

403

Access denied

Bad Request

400

Invalid input

Method Not Allowed

405

Wrong HTTP method


Real-World Scenarios

E-Commerce Cart API

Database Query



Summary

  • Retry automatically retries failed steps

  • Use for transient failures only (not permanent errors)

  • Exponential backoff is best for most scenarios

  • Balance speed and reliability with appropriate settings

  • Monitor retry success rates to validate configuration

  • Combine with Wait for predictable behavior


Next: Learn about Stop Action for conditional workflow termination.

Last updated