Guide The jobs it is for
“It needs to be there at 8 a.m.”
What you are trying to do#
The report has to be in people’s inboxes before the office opens. Today you get up early, or it is late. You want it to run on a schedule, tell you when it worked, and raise an alarm when it did not, including when it never ran at all.
Steps#
- Put the pipeline in a workflow. Open the pipeline and choose Run options (the arrow beside Run) › Schedule…, or type “Schedule this pipeline in a workflow” in the command palette (⌘K / Ctrl+K). Or open Workflows on the rail (⌘5 / Ctrl+5) and choose New workflow. A workflow is a small chart: it starts, runs one or more pipelines, and can wait, branch, ask for review, deliver and tidy up files.
- Set when it starts. Select the start of the chart and open the Triggers tab of the inspector on the right. Add a trigger › On a schedule, then choose the rule: Every day, On chosen weekdays, Monthly, on a date, Monthly, on the nth working day, Monthly, on the nth weekday, Every few minutes, A cron expression or Once. Give the time on the 24-hour clock and the Time zone (“The clock it keeps, also across summer time”). Under Working days and holidays, choose a holiday calendar and what happens On a holiday: run anyway, skip, or run on the working day before or after.
- Check the next runs. The workflow’s header shows “Next: …”, and the trigger lists the next runs it will make, so you can see that “the 2nd working day” means what you think.
- Say what happens if the computer was off. If the computer was off or asleep: Run every missed time, in order, Skip the missed runs, or Run once, for the latest time missed. Tick Wake the computer to run it where the operating system allows (see Waking the computer).
- Set a deadline alert. In the Settings tab, under Deadline alert, tick Alert if it has not succeeded by a time and give the time, such as 09:00. It “tells you when the workflow has not succeeded by a time on a day it was due, even if it never started: the computer was off, or the trigger never fired.”
- Choose who is told. Under Notifications: When it fails (“Says what failed and what was not written, with a button that opens the failing step”), When it finishes with warnings, and When it succeeds (off by default: the tray shows it). Each can go to the desktop, by email, or to Slack or Teams. After repeated failures, also tell a second person.
- Switch the workflow on. The switch in the workflow’s header reads “On: its triggers start it” or “Off: only a manual run starts it”.
- Keep the agent running. Scheduled workflows are run by the background agent, which lives in the system tray (the menu bar on macOS) and keeps running when you close the window. To run with nobody logged in, install it as a service in Settings › Background agent. See The background agent.
What you will see#
- The tray icon shows what is running, what is next and how the last runs went. Its menu has Pause all workflows and Run a workflow now.
- A successful run sends no notification by default. A failure sends one at once: “Daily orders stopped. Check failed: Order ID is unique, 37 duplicates. Nothing was written.” with Open at the failing step.
- The Runs view (⌘4 / Ctrl+4) shows every run on a timeline, by workflow and pipeline, with scheduled runs ahead. Click a run to read its record. Health shows success rates and durations; Needs attention lists what needs you.
When it goes wrong#
| You see | What it means and what to do |
|---|---|
| “Monthly sales has not succeeded by 09:00” | The deadline passed without a successful run. Open Runs to see whether it ran and stopped, is still running, or never started |
| A run marked “Skipped” | The computer was off or asleep when it was due and the missed-run policy skipped it |
| Nothing ran while the laptop was closed | A laptop that is asleep cannot run anything. Allow waking it, install the agent as a service, or let an always-on computer run the schedules: The headless runner |
| A run waits for a long time | It may be waiting for a file, a drive, a connection or mains power (Wait before starting in Settings), or queued behind another run: the same workflow never runs twice at once |
| Temporary problems repeat | A locked file or a lost connection is tried again with growing pauses (Retries in Settings). A failed check is never retried, because retrying cannot fix it |
See also#
- Workflows and the background agent.
- Walkthrough 2, a schedule on the 2nd working day at 07:00 with a review gate and a 09:00 deadline.