Overview
Webhooks allow you to receive HTTP notifications when jobs complete, eliminating the need for polling.Setup
Include awebhook_url in your job request:
Webhook Payload
When a job completes, Tornado sends aPOST request to your webhook_url with a JSON payload. Here’s what your server will receive:
Single Job Completion
Job Failed
Batch Completion
When all episodes in a batch are done:Webhook Behavior
| Aspect | Behavior |
|---|---|
| Method | POST |
| Content-Type | application/json |
| Timeout | 30 seconds |
| Retries | 3 attempts with exponential backoff |
Handling Webhooks
Node.js (Express)
Python (Flask)
Best Practices
Respond Quickly
Respond Quickly
Return a 2xx status code within 30 seconds. Process the webhook data asynchronously if needed.
Verify Source
Verify Source
Webhooks come from our servers. Consider IP whitelisting or signature verification for production.
Idempotency
Idempotency
Handle duplicate webhooks gracefully. Store the job_id and check for duplicates before processing.
Retry Logic
Retry Logic
If your endpoint fails, we retry 3 times. Ensure your handler can process the same event multiple times.
