Schedules
Run workers automatically on a cron schedule in any IANA timezone. Schedules create a new Job on each firing with the configured input payload.
Create a schedule
bash
POST /v1/ava/schedules| Name | Type | Required | Description |
|---|---|---|---|
| worker_id | string | Yes | Worker to run on each schedule fire. |
| cron | string | Yes | 5-part cron expression (minute hour day month weekday). |
| timezone | string | Yes | IANA timezone (e.g. "Australia/Sydney", "UTC", "America/New_York"). |
| name | string | No | Friendly name for this schedule. |
| input | object | No | Payload injected into each triggered job. |
| enabled | boolean | No | Whether the schedule is active. Defaults to true. |
bash
# Every weekday at 9am Sydney time
curl -X POST https://api.hldgroup.org/v1/ava/schedules \
-H "x-internal-secret: <key>" \
-H "x-tenant-id: ten_01hxyz" \
-H "x-user-id: usr_01hxyz" \
-H "x-platform-role: tenant-system-admin" \
-H "Content-Type: application/json" \
-d '{
"worker_id": "wkr_01hxyz",
"name": "Daily 9am security digest",
"cron": "0 9 * * 1-5",
"timezone": "Australia/Sydney",
"input": { "channel": "#security-ops", "period": "daily" }
}'Common cron expressions
| Name | Type | Required | Description |
|---|---|---|---|
| 0 9 * * 1-5 | cron | No | Every weekday at 9:00am. |
| */15 * * * * | cron | No | Every 15 minutes. |
| 0 0 * * * | cron | No | Daily at midnight. |
| 0 8 1 * * | cron | No | First of every month at 8am. |
| 0 */4 * * * | cron | No | Every 4 hours. |
Pause and resume
bash
# Pause — skips all upcoming firings
PATCH /v1/ava/schedules/:id
{ "enabled": false }
# Resume
PATCH /v1/ava/schedules/:id
{ "enabled": true }Delete a schedule
bash
DELETE /v1/ava/schedules/:idHard deletes the schedule. Pending jobs already created by this schedule continue to run. To stop all future firings immediately, pause the schedule first, then delete.
Warning:Cron expressions are evaluated in the
timezone you specify. Forgetting to set timezone means UTC — schedules that should fire at 9am local time will run at the wrong hour.