Skip to content

Scheduling

Give a pipeline a cron expression in schedule and the platform runs it automatically while it is enabled.

The scheduler is APScheduler running inside the API process. Once a minute it:

  1. loads every pipeline with enabled = true and a non-null schedule;
  2. checks whether the schedule’s most recent fire time was less than 60 seconds ago;
  3. if so, creates a pending run with triggered_by: "schedule", unless the pipeline already has a pending or running run.

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.

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)
* * * * *
ExpressionRuns
*/15 * * * *Every 15 minutes
0 * * * *Every hour
0 */6 * * *Every 6 hours
0 2 * * *Daily at 02:00 UTC
0 9 * * 1Mondays 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.

In the UI, pick a preset or Custom… in the pipeline form.

With the API:

Terminal window
curl -X PUT http://localhost:8000/api/pipelines/<id> \
-H "Content-Type: application/json" \
-d '{"schedule": "0 2 * * *"}'

To pause a pipeline, disable it:

Terminal window
curl -X PUT http://localhost:8000/api/pipelines/<id> \
-H "Content-Type: application/json" \
-d '{"enabled": false}'

Disabled pipelines can still be run manually.

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.