Scheduling
Give a pipeline a cron expression in schedule and the platform runs it automatically while it is enabled.
How it works
Section titled “How it works”The scheduler is APScheduler running inside the API process. Once a minute it:
- loads every pipeline with
enabled = trueand a non-nullschedule; - checks whether the schedule’s most recent fire time was less than 60 seconds ago;
- if so, creates a
pendingrun withtriggered_by: "schedule", unless the pipeline already has apendingorrunningrun.
Workers then pick the run up like any other. Because a run is skipped while another is active, a pipeline never runs twice in parallel, and a slow run simply absorbs the ticks that fall during it.
Because the scheduler lives in the API, scheduled runs stop while the API is down. Ticks missed during downtime are not caught up. If you run several API replicas, each one has its own scheduler; keep a single replica.
Cron syntax
Section titled “Cron syntax”Use the standard five fields:
┌───────── minute (0-59)│ ┌─────── hour (0-23)│ │ ┌───── day of month (1-31)│ │ │ ┌─── month (1-12)│ │ │ │ ┌─ day of week (0-6, Sunday = 0)* * * * *| Expression | Runs |
|---|---|
*/15 * * * * | Every 15 minutes |
0 * * * * | Every hour |
0 */6 * * * | Every 6 hours |
0 2 * * * | Daily at 02:00 UTC |
0 9 * * 1 | Mondays at 09:00 UTC |
0 0 1 * * | First day of the month at 00:00 UTC |
The API validates expressions with croniter and returns 400 for invalid ones. The UI accepts five fields only and offers presets: hourly, every 6 hours, daily at midnight, daily at 9am, Mondays at 9am and monthly. The finest useful granularity is one minute.
Set a schedule
Section titled “Set a schedule”In the UI, pick a preset or Custom… in the pipeline form.
With the API:
curl -X PUT http://localhost:8000/api/pipelines/<id> \ -H "Content-Type: application/json" \ -d '{"schedule": "0 2 * * *"}'To pause a pipeline, disable it:
curl -X PUT http://localhost:8000/api/pipelines/<id> \ -H "Content-Type: application/json" \ -d '{"enabled": false}'Disabled pipelines can still be run manually.
Find scheduled runs
Section titled “Find scheduled runs”Each run records how it started in triggered_by: schedule or manual. GET /api/pipelines/{id}/runs returns them newest first. It has no filter on triggered_by, so filter on the client.