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.
Retry configuration
Section titled “Retry configuration”Set retry behavior when creating a task:
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" }'| Field | Default | Description |
|---|---|---|
maxRetries | 3 | Maximum retry attempts (0-10). Set to 0 for no retries. |
retryBackoff | "exponential" | Backoff strategy: exponential or linear |
Backoff strategies
Section titled “Backoff strategies”Exponential backoff (default) - delays double with each retry:
| Retry | Delay |
|---|---|
| 1 | 1 second |
| 2 | 2 seconds |
| 3 | 4 seconds |
| 4 | 8 seconds |
| 5 | 16 seconds |
Linear backoff - delays increase by a fixed amount:
| Retry | Delay |
|---|---|
| 1 | 1 second |
| 2 | 2 seconds |
| 3 | 3 seconds |
| 4 | 4 seconds |
| 5 | 5 seconds |
What triggers a retry
Section titled “What triggers a retry”- Network errors (connection refused, DNS failure, socket timeout)
- HTTP 5xx responses (server errors)
- Request timeout (exceeding the
timeoutvalue)
What does NOT trigger a retry
Section titled “What does NOT trigger a retry”- HTTP 2xx responses (treated as success)
- HTTP 3xx responses (redirects are followed automatically)
- HTTP 4xx responses (client errors are treated as completed, not retried)
After all retries fail
Section titled “After all retries fail”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.