Deploy

Scheduled jobs

A Scheduled Job resource ("source": "job") is a command the host runs on a schedule and nothing in between — a nightly report, a cleanup, a sync. It takes a repository (built like an app, deploys on push) OR a prebuilt image, a command, a five-field cron and an IANA timezone (default UTC). It gets the project's network and the same injected variables as an app, never a hostname.

{ "name": "nightly-report", "source": "job",
  "repoUrl": "https://github.com/you/app", "branch": "main",
  "startCommand": "npm run report",
  "schedule": "0 3 * * *", "scheduleTz": "America/New_York" }

Rules: one run at a time — a run still going when the next occurrence comes skips it rather than stacking; a run is killed after an hour; the last 50 runs are kept with their output. A failed scheduled run is told once on the project's Alerts (job-failed, on by default), and once when a run works again; see Alerts. The Runs tab shows the schedule (editable), Run now / Stop, and every run with its status, exit code and duration — click one for its output. The first run needs the first deploy to have finished. API: GET …/runs, POST …/runs (run now, 202; 409 while one runs), POST …/runs/stop, GET …/runs/{runId}/log; PATCH the resource with schedule/scheduleTz to change the cron.

Something wrong or missing here? Tell us and a person will answer.