Skip to main content

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. Total Retry Attempts: 3 retries (4 total delivery attempts including the initial attempt) Backoff Strategy: Exponential backoff starting with a 5-second delay, doubling with each retry Request Timeout: Each delivery attempt will timeout after 10 seconds if no response is received

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: Important: The 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 failureCount is incremented
  • The webhook’s lastFailedAt timestamp 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 failures
  • MAX_FAILURES constant: Set to 5 (currently not enforced but available for future use)
You can monitor these metrics to manually disable problematic webhooks.

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:
2

View your webhooks with their current status

  • Active (green) - Webhook is enabled and functional
  • Inactive (gray) - Webhook is disabled
  • Disabled (red) - Webhook has been disabled due to issues

Webhook Health Metrics

Each webhook tracks important metrics: These metrics are updated automatically:
  • On success: failureCount resets to 0, lastSuccessAt and lastDeliveredAt are updated
  • On failure: failureCount increments by 1, lastFailedAt is updated

Implement Your Own Monitoring

Set up your own monitoring for webhook health:
Nodejs

Best Practices

Always return a 2xx status code when your endpoint successfully receives and processes a webhook:
Nodejs
Use the X-Webhook-Delivery-Id header to prevent duplicate processing during retries:
Nodejs
Alternative: Database-based idempotency
Nodejs
Return appropriate status codes based on the type of error:
Nodejs
Your endpoint MUST respond within 10 seconds or the request will timeout. Process webhooks asynchronously:
Nodejs
Keep detailed logs of all webhook delivery attempts for debugging:
Nodejs
Test how your endpoint handles retries in development:
Nodejs
AutoSend processes up to 5 webhooks concurrently. Ensure your endpoint can handle concurrent requests:
Nodejs

Troubleshooting

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
Solutions:
  1. Test your endpoint manually:
  1. Check your server logs for error messages
  2. Verify SSL certificate is valid:
  1. Check response time:
  1. Monitor your server resources (CPU, memory, disk) to ensure it’s not overloaded
  2. Check for rate limiting on your server or firewall
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
Solutions:See Verify Webhook Requests for detailed troubleshooting.Quick verification test:
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
Solutions:
  1. Use background job queues:
  1. Optimize database queries:
  1. Add database indexes:
  1. Use connection pooling:
  1. Cache frequently accessed data:
Symptoms: Same webhook processed multiple timesPossible Causes:
  • Not implementing idempotency
  • Retry logic processing same delivery multiple times
  • Race conditions in distributed systems
Solutions:Implement idempotency using X-Webhook-Delivery-Id (see Best Practices section above).
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
Solutions:
  1. Check webhook configuration in AutoSend dashboard
  2. Verify event types are selected for the webhook
  3. Check webhook is active (not disabled)
  4. Test webhook URL is accessible from external networks
  5. Check firewall rules allow incoming traffic on your endpoint port
  6. Review AutoSend delivery logs for delivery attempts

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