Execution & Retries
What happens each time a job fires: the execution record it leaves behind, how failures are retried, and when a job is paused for you.
Execution History
Every firing is recorded as an execution. Query the history to debug failures or monitor delivery.
curl -X POST https://api.travila.ai/api/v1/scheduler/list-executions \
-H "X-API-Key: sk_your_key_here" \
-H "X-On-Behalf-Of: user_123" \
-H "Content-Type: application/json" \
-d '{
"schedule_id": "sched_a1b2c3d4e5f60718",
"page_size": 20,
"status_filter": "EXECUTION_STATUS_FAILED"
}'
Execution records include:
| Field | Description |
|---|---|
status | EXECUTION_STATUS_SUCCESS, EXECUTION_STATUS_FAILED, EXECUTION_STATUS_MALFORMED, EXECUTION_STATUS_DISCARDED (retries exhausted), or EXECUTION_STATUS_CANCELLED (operator cancellation) |
http_status | HTTP status code returned by the target |
attempt | Attempt number (1-based) within this firing |
duration_ms | End-to-end duration of the delivery attempt |
error | Error message on FAILED or MALFORMED outcomes |
scheduled_time | When the execution was supposed to fire |
started_at / completed_at | Actual start and completion times |
response_body | Truncated HTTP response body captured on failed dispatches (4 KiB cap). Empty for successful dispatches. |
response_headers | Allowlisted response headers from the failed dispatch: content-type, content-length, retry-after, x-request-id, date. |
response_truncated | true when response_body was clipped at the 4 KiB cap. |
response_size_bytes | Original response size in bytes (from Content-Length when present, else total bytes read before truncation). |
Retry Policy
Each firing retries independently with exponential backoff until it succeeds or exhausts max_attempts.
| Field | Default | Description |
|---|---|---|
max_attempts | 10 | Total delivery attempts including the initial one |
initial_backoff_ms | 5000 | Backoff before the first retry (5 seconds) |
max_backoff_ms | 1800000 | Maximum backoff cap (30 minutes) |
To override the defaults, include a retry_policy in your create-job request:
curl -X POST https://api.travila.ai/api/v1/scheduler/create-job \
-H "X-API-Key: sk_your_key_here" \
-H "X-On-Behalf-Of: user_123" \
-H "Content-Type: application/json" \
-d '{
"name": "Critical alert",
"schedule_type": "SCHEDULE_TYPE_CRON",
"cron_expression": "*/5 * * * *",
"target": {
"url": "https://your-api.example.com/jobs/alert",
"kind": "alert"
},
"retry_policy": {
"max_attempts": 3,
"initial_backoff_ms": 1000,
"max_backoff_ms": 10000
}
}'
Auto-Pause
A job is automatically paused when it accumulates N consecutive failures. This prevents a broken target from accumulating unbounded retry debt.
- Default threshold: 10 consecutive failures (applied when
auto_pause_thresholdis omitted or set to0) - Valid override range: 3–100
- When auto-paused, the job state becomes
SCHEDULE_STATE_PAUSEDandpaused_reasonrecords the cause
Resume the job with resume-job once the target is healthy.