Run jobs and pipelines
A job runs work that finishes, such as a cleanup, an import, or a report, instead of a server that stays up. Jobs run on the same cluster as your apps, so a job can reach your apps and databases without exposing them. Each job runs one or more steps in order, on a cron schedule or when you start it.
Step types
Section titled “Step types”| Step | Runs |
|---|---|
| Script | bash, python, or node source that you enter |
| App command | A command inside the image of an existing app |
| Custom image | Any container image, with an optional command |
Create a job
Section titled “Create a job”- In the sidebar, go to Jobs.
- Select New job.
- Select the project.
- In Name, enter a name, such as
nightly-cleanup. - In Schedule, select a preset, Custom cron…, or Manual only.
- In If a run is still going, select Skip the new run or Run them in parallel.
- Add one or more steps.
- Select the type of each step.
- (Optional) Set a timeout, retries, and CPU for each step.
- Select Create job.
-
Write the steps to a JSON file.
-
Create the job:
orchard job create --name nightly-cleanup --cron "0 2 * * *" --steps steps.json
The --concurrency flag accepts forbid, the default, or allow. The --timezone flag sets the IANA time zone for the schedule. The default is UTC.
A job with a schedule runs as a Kubernetes CronJob. A job without one runs only when you start it.
Run a job
Section titled “Run a job”Open the job and select Run now.
orchard job run <id>To pause a schedule, select Pause on the job page, or run orchard job pause <id>.
Read a run
Section titled “Read a run”Each run has a status, a duration, and output for each step. Steps run in order, and each one has its own logs and exit code. Orchard keeps past runs on the job page. To list them from the CLI, run orchard job runs <id>.
Choose a script image
Section titled “Choose a script image”Script steps run in a small image for the language you select.
| Runtime | Default image |
|---|---|
bash | debian:12.15-slim |
python | python:3.12.16-slim |
node | node:22.23.5-slim |
These images leave out common tools. For example, debian:12.15-slim has no curl or wget. If a step needs a tool, use a Custom image step, or install the tool in the first line of the script.
To change a default image for the whole instance, set JOB_RUNTIME_IMAGE_BASH, JOB_RUNTIME_IMAGE_PYTHON, or JOB_RUNTIME_IMAGE_NODE on the server.
Reach an app from a job
Section titled “Reach an app from a job”A job in the same environment as an app can reach the app by its internal address.
Related resources
Section titled “Related resources”- Set up notifications - Send
job.succeededandjob.failedevents to Slack, Discord, email, or a webhook. orchard jobreference - Everyorchard jobcommand and flag.