main
once a day.
You need a connected git source (PUT /api/v1/apps/{name}/git-source).
A schedule redeploys through the same path a webhook push does, so there
has to be a repo to redeploy from.
Configure
- UI
- CLI
- API
Open the app, then Deploy settings, and use the Scheduled deploys card. It has the same fields as the CLI, a next-run preview, and a short history list.
timezone defaults to UTC. enabled defaults to
true; set it to false (CLI: --disable) to keep a schedule configured but paused.
How it fires
A scheduler inside the control plane process checks everyAPP_SCHEDULE_DEPLOY_SCHEDULER_INTERVAL (default 1m; standard cron has
no granularity finer than a minute, so a shorter interval buys nothing)
which schedules are due, and redeploys the latest commit on the
configured branch through the same git-source deploy path a webhook push
uses. The resulting deploy is recorded with trigger schedule
(GET /api/v1/deployments?trigger=schedule, or levelrail-cli apps deploys list), distinct from git push, manual, api, rollback and
preview.
Freeze windows
A schedule due while a deploy freeze window is active is skipped, not forced: no deploy is triggered, and the skip is recorded in the schedule’s history with the freeze’s reason and end time. It is not queued to run once the freeze lifts; it waits for its next natural occurrence, the same way a schedule due outside any freeze always has.Restart and catch-up semantics
Each schedule persists its own next-fire time in the database, not only in the control plane process’s memory. Two cases follow from that:- A schedule seen for the first time (just created, or just re-enabled) is armed to its next occurrence and does not fire immediately. This matches Levelrail’s other cron-driven features (scheduled tasks, scheduled backups).
- When the control plane restarts, a schedule that was due, or that missed one or more occurrences while the process was down, still fires at most once the next time it is checked, for the most recent due occurrence, never once per missed occurrence. It then resumes its normal cadence. This is a deliberate difference from scheduled tasks and scheduled backups, whose position lives only in memory and is lost on restart: a missed scheduled deploy is worth catching up once, a missed backup or task run is not.
One-time deploy
Instead ofcron, a schedule can carry run_at: an RFC 3339 timestamp at
which the deploy fires once. Set exactly one of cron or run_at; both or
neither is rejected. run_at must be at least
APP_SCHEDULE_RUN_AT_MIN_LEAD (default 1m) and at most
APP_SCHEDULE_RUN_AT_MAX_HORIZON (default 8760h, one year) from now.
run_at, through the
same deploy path as a recurring schedule, then marks it completed and
disabled so it never fires again. GET .../schedule shows run_at,
next_run_at (equal to run_at while pending) and completed_at once done;
history records the run like any other.
- Freeze windows: a one-time deploy due during a freeze is recorded as
skipped_freezeand completed. It is not queued until the freeze lifts. - Catch-up: if the control plane was down at
run_at, the deploy fires once on restart when it is withinAPP_SCHEDULE_ONESHOT_CATCHUPofrun_at(default24h,0for no limit). Later than that it is recorded asskipped_missedand completed. - Re-arm: a
PUTwith a newrun_aton a completed schedule re-arms it. - Cancel: disable it with
apps schedule set ... --disable(or"enabled": false) before it fires. There is no separate delete command.
One-shot scheduled deploys
A one-shot scheduled deploy has its own id, so an app can have several, each listed and canceled on its own. It deploys either an image or the latest commit of a git ref (a branch) once at a set time. This is separate from the single per-app schedule above, which stays the way to run a recurring cron deploy.- UI
- CLI
- API
In Deploy, choose an image, tick Schedule for later, and pick a date and
time (shown in your browser timezone). The Scheduled deploys card on the
app’s Deploys tab lists pending and recent ones and cancels a pending one.
The run itself appears in deploy history with the trigger “a schedule”.
run_at follows the same minimum lead and horizon as a one-time schedule
(APP_SCHEDULE_RUN_AT_MIN_LEAD, APP_SCHEDULE_RUN_AT_MAX_HORIZON). Creating
and canceling need the deploy ability, reading needs read.
How it runs
A reconciler scans everyAPP_SCHEDULE_DEPLOY_SCHEDULER_INTERVAL for pending
rows whose run_at has passed, so it is level-triggered and survives a restart.
- Grace: a row still within
APP_SCHEDULED_DEPLOY_GRACE(default5m) ofrun_atruns. An older one is markedmissed, recorded on the app timeline and sent to the app’s deploy notification targets. - Freezes: a deploy due inside a freeze window
is marked
skipped_freezewith the freeze reason and end time. It is not queued until the freeze lifts. - Gates: it goes through the normal deploy path: deploy policy, image
signature enforcement and the running-deploy guard. For an app in a protected
environment an image deploy becomes a pending deploy approval
attributed to whoever scheduled it (status
pending_approval); a git ref deploy is refused there, so use an image. - Never twice: a row is claimed before it executes. One left in
runninglonger thanAPP_SCHEDULED_DEPLOY_STALE_RUN(default30m), for example after a crash, is closed asfailedand not retried. - History: the attempt is recorded with trigger
schedule, the same as a recurring scheduled deploy.
API
MCP
get_app_schedule and get_app_schedule_history are read-only. Changing
a schedule stays with the dashboard and CLI, the same split deploy
freeze windows already use.
See also
- Deploy safety for freeze windows and the stale-deploy guard a scheduled deploy respects the same way any other automatic deploy does.
- Git integrations for connecting the git source a schedule redeploys from.