Skip to main content

Webhooks

A1Cron supports webhook callbacks to notify your application about cron job execution results in real-time. You can configure separate URLs for successful and failed executions.

Webhook Configuration

When creating or updating a cron job, you can specify webhook URLs in the callbacks object:

Webhook Payload

Both success and failure webhooks receive the same payload structure:
string
The unique identifier of the cron job
string
The name of the cron job
string
Unique identifier for this specific execution
string
Execution status: success, failure, error, or timeout
string
ISO 8601 timestamp of when the job was executed
integer
HTTP response code from the endpoint (null for timeouts)
integer
Time taken for the request in milliseconds
string
Response body from the endpoint (truncated to 1KB)
string
Error message if the execution failed (null for success)
integer
Which retry attempt this was (0 for first attempt)
string
ISO 8601 timestamp of next retry (null if no more retries)

Webhook Examples

Success Webhook Payload

Failure Webhook Payload

Timeout Webhook Payload

Implementing Webhook Handlers

Node.js Express Example

Python Flask Example

Webhook Security

Verify Webhook Signatures

A1Cron signs webhook payloads using HMAC-SHA256. Verify the signature to ensure the webhook is from A1Cron:

IP Whitelisting

For additional security, whitelist A1Cron’s webhook IP addresses:
  • 52.89.214.238
  • 34.212.75.30
  • 54.218.53.128

Webhook Best Practices

Return a 2xx status code within 10 seconds. Process heavy operations asynchronously.
Use the execution_id to prevent duplicate processing:
A1Cron retries failed webhook deliveries up to 3 times with exponential backoff.
Log all webhook receipts and failures for debugging:

Common Use Cases

Alert on Failures

Track Execution Metrics

Chain Dependent Jobs

Testing Webhooks

Use webhook.site to test webhook integration:
  1. Go to webhook.site to get a unique URL
  2. Use it as your webhook URL when creating a cron job
  3. Trigger the cron job manually
  4. View the webhook payload on webhook.site
Example: