Action Retrier

Add automatic retry logic with exponential backoff to Convex actions calling unreliable external APIs and services.

Installation

npm install @convex-dev/action-retrier

About Action Retrier

Actions can sometimes fail due to network errors, server restarts, or issues with a 3rd party API, and it's often useful to retry them. The Action Retrier component makes this really easy.

Benefits

Use cases

how to add retry logic to Convex actions

Action Retrier wraps your Convex actions with configurable retry behavior for external API calls. You specify the number of attempts and delay strategy, and it automatically retries failed requests with exponential backoff.

handling API failures in Convex mutations

Use Action Retrier to wrap external API calls within your Convex actions. It catches transient errors and retries the operation according to your configuration, preventing temporary network issues from breaking your application flow.

exponential backoff for external services Convex

Action Retrier implements exponential backoff with jitter for external service calls in Convex actions. Configure maximum retry attempts and base delay, and it handles the retry timing automatically to avoid overwhelming downstream services.

Frequently asked questions

Does Action Retrier work with all external APIs?

Action Retrier works with any external API call made from Convex actions, but it's designed for idempotent operations. You configure which error types trigger retries and which should fail immediately.

How does retry logic affect action execution time?

Action Retrier uses exponential backoff, so retry delays increase with each attempt. The total execution time depends on your configured retry count and base delay. Failed retries will extend your action's runtime but improve reliability.

Can I customize retry behavior for different services?

Yes, Action Retrier allows per-service configuration of retry attempts, delay intervals, and which error conditions should trigger retries versus immediate failure.

What happens if all retry attempts fail?

When Action Retrier exhausts all configured retry attempts, it throws the last error encountered. Your Convex action can then handle this final failure state according to your application logic.

Links