Automatic Retries
AutoSend automatically retries webhook deliveries that fail due to network errors, timeouts, or non-2xx status codes from your endpoint.Retry Schedule
If AutoSend does not receive a 2xx (200-299) response from your webhook endpoint, we will retry the webhook delivery using an exponential backoff strategy.| Attempt | Approximate Delay After Previous Failure |
|---|---|
| 1st Retry | ~5 seconds |
| 2nd Retry | ~10 seconds |
| 3rd Retry | ~20 seconds |
Example Timeline
When Retries Occur
Retry Triggers
AutoSend will retry webhook deliveries when:- Non-2xx status codes are returned (400, 401, 403, 404, 500, 502, 503, 504, etc.)
- Network errors occur (connection refused, DNS resolution failure, etc.)
- Timeouts happen (no response within 10 seconds)
- SSL/TLS errors are encountered
- Request aborted due to timeout
No Retry for Success
If your endpoint returns any 2xx status code (200-299), the delivery is marked as successful and no retries will occur.Webhook Headers
Every webhook delivery includes these headers:| Header | Description | Example |
|---|---|---|
Content-Type | Always application/json | application/json |
X-Webhook-Signature | HMAC-SHA256 signature for verification | a1b2c3d4e5f6... |
X-Webhook-Event | The event type being delivered | email.sent |
X-Webhook-Delivery-Id | Unique ID for this delivery (same across retries) | deliver-webhook-123456 |
X-Webhook-Timestamp | Unix timestamp (milliseconds) when sent | 1699876543210 |
X-Webhook-Delivery-Id remains the same across all retry attempts for the same webhook event, making it perfect for implementing idempotency.
After All Retries Fail
After the conclusion of all retry attempts (initial + 3 retries = 4 total attempts), if the webhook still hasn’t been delivered successfully, the delivery will be marked as failed in the system.What Happens Next
- The delivery log will show the final failure status
- The webhook’s
failureCountis incremented - The webhook’s
lastFailedAttimestamp is updated - Failed delivery records are kept for 48 hours for debugging
- AutoSend will not automatically retry it again
Webhook Auto-Disable (Optional)
By default, webhooks are NOT automatically disabled after consecutive failures. However, the system tracks:failureCount: Number of consecutive delivery failuresMAX_FAILURESconstant: Set to 5 (currently not enforced but available for future use)
Delivery Logs
Log Retention
AutoSend keeps delivery attempt logs for debugging:- Successful deliveries: Retained for 24 hours
- Failed deliveries: Retained for 48 hours
- Maximum completed jobs kept: 1,000 most recent
Log Information
Each delivery log includes:- Webhook ID and organization/project IDs
- Event type
- Full payload sent
- Destination URL
- HTTP status code
- Response body and headers
- Success/failure status
- Error message (if failed)
- Number of attempts made
- Duration of the request (in milliseconds)
- Timestamp of the delivery attempt
Monitoring Your Webhooks
Check Webhook Status
Monitor your webhooks from the AutoSend dashboard:Webhook Health Metrics
Each webhook tracks important metrics:| Metric | Description |
|---|---|
failureCount | Number of consecutive delivery failures |
lastSuccessAt | Timestamp of last successful delivery |
lastFailedAt | Timestamp of last failed delivery |
lastDeliveredAt | Timestamp of last delivery attempt (any) |
isActive | Whether the webhook is enabled |
status | Current status (active/inactive/disabled) |
- On success:
failureCountresets to 0,lastSuccessAtandlastDeliveredAtare updated - On failure:
failureCountincrements by 1,lastFailedAtis updated
Implement Your Own Monitoring
Set up your own monitoring for webhook health:Nodejs
Best Practices
Return 2xx for Successful Processing
Return 2xx for Successful Processing
Always return a 2xx status code when your endpoint successfully receives and processes a webhook:
Nodejs
Implement Idempotency with Delivery ID
Implement Idempotency with Delivery ID
Use the Alternative: Database-based idempotency
X-Webhook-Delivery-Id header to prevent duplicate processing during retries:Nodejs
Nodejs
Differentiate Between Temporary and Permanent Errors
Differentiate Between Temporary and Permanent Errors
Return appropriate status codes based on the type of error:
Nodejs
Respond Quickly (Under 10 Seconds)
Respond Quickly (Under 10 Seconds)
Your endpoint MUST respond within 10 seconds or the request will timeout. Process webhooks asynchronously:
Nodejs
Log All Delivery Attempts
Log All Delivery Attempts
Keep detailed logs of all webhook delivery attempts for debugging:
Nodejs
Test Retry Behavior
Test Retry Behavior
Test how your endpoint handles retries in development:
Nodejs
Handle Concurrent Deliveries
Handle Concurrent Deliveries
AutoSend processes up to 5 webhooks concurrently. Ensure your endpoint can handle concurrent requests:
Nodejs
Troubleshooting
High Failure Rate
High Failure Rate
Symptoms: Webhooks failing frequentlyPossible Causes:
- Endpoint is down or unreachable
- Endpoint is timing out (>10 seconds)
- Endpoint is returning non-2xx status codes
- SSL/TLS certificate issues
- Rate limiting on your server
- Test your endpoint manually:
- Check your server logs for error messages
- Verify SSL certificate is valid:
- Check response time:
- Monitor your server resources (CPU, memory, disk) to ensure it’s not overloaded
- Check for rate limiting on your server or firewall
Signature Verification Failures
Signature Verification Failures
Symptoms: All webhooks returning 401 or failing signature verificationPossible Causes:
- Using wrong webhook secret
- Incorrect signature verification logic
- Body parsing issues (modified body)
- Character encoding issues
Timeout Issues
Timeout Issues
Symptoms: Webhooks timing out (10 second timeout)Possible Causes:
- Synchronous processing taking too long
- Database queries are slow
- External API calls are slow
- No connection pooling
- Inefficient code
- Use background job queues:
- Optimize database queries:
- Add database indexes:
- Use connection pooling:
- Cache frequently accessed data:
Duplicate Processing
Duplicate Processing
Symptoms: Same webhook processed multiple timesPossible Causes:
- Not implementing idempotency
- Retry logic processing same delivery multiple times
- Race conditions in distributed systems
X-Webhook-Delivery-Id (see Best Practices section above).Missing Webhooks
Missing Webhooks
Symptoms: Not receiving expected webhooksPossible Causes:
- Webhook not configured for the event type
- Webhook is inactive or disabled
- Firewall blocking incoming requests
- Incorrect URL configured
- Check webhook configuration in AutoSend dashboard
- Verify event types are selected for the webhook
- Check webhook is active (not disabled)
- Test webhook URL is accessible from external networks
- Check firewall rules allow incoming traffic on your endpoint port
- Review AutoSend delivery logs for delivery attempts
Related Resources
Introduction
Getting started with webhooks
Event Types
Complete list of webhook events
Verify Webhook Requests
Security and signature verification
Webhooks
Manage your webhooks from the AutoSend sidebar