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
NameTypeRequiredDescription
worker_idstringYesWorker to run on each schedule fire.
cronstringYes5-part cron expression (minute hour day month weekday).
timezonestringYesIANA timezone (e.g. "Australia/Sydney", "UTC", "America/New_York").
namestringNoFriendly name for this schedule.
inputobjectNoPayload injected into each triggered job.
enabledbooleanNoWhether 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

NameTypeRequiredDescription
0 9 * * 1-5cronNoEvery weekday at 9:00am.
*/15 * * * *cronNoEvery 15 minutes.
0 0 * * *cronNoDaily at midnight.
0 8 1 * *cronNoFirst of every month at 8am.
0 */4 * * *cronNoEvery 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/:id

Hard 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.