Skip to content

Retries and Backoff

When a callback fails, AsyncQueue retries the request according to your configuration. You control the maximum number of attempts and the backoff strategy.

Set retry behavior when creating a task:

Terminal window
curl -X POST https://api.asyncqueue.io/v1/tasks \
-H "Authorization: Bearer your-api-key" \
-H "Content-Type: application/json" \
-d '{
"targetUrl": "https://api.example.com/webhook",
"maxRetries": 5,
"retryBackoff": "exponential"
}'
FieldDefaultDescription
maxRetries3Maximum retry attempts (0-10). Set to 0 for no retries.
retryBackoff"exponential"Backoff strategy: exponential or linear

Exponential backoff (default) - delays double with each retry:

RetryDelay
11 second
22 seconds
34 seconds
48 seconds
516 seconds

Linear backoff - delays increase by a fixed amount:

RetryDelay
11 second
22 seconds
33 seconds
44 seconds
55 seconds
  • Network errors (connection refused, DNS failure, socket timeout)
  • HTTP 5xx responses (server errors)
  • Request timeout (exceeding the timeout value)
  • HTTP 2xx responses (treated as success)
  • HTTP 3xx responses (redirects are followed automatically)
  • HTTP 4xx responses (client errors are treated as completed, not retried)

When all retry attempts are exhausted, the task moves to failed status with an error message. If you configured an onCompleteUrl, AsyncQueue sends a webhook notification with the failure details.

The task’s retryCount field shows how many retry attempts were made.