Cron, with the safety rails on.
Chase unpaid invoices every Monday, mark loans overdue every morning, sync orders every five minutes. Each job runs in the time zone you give it, can skip a time while its last run is still going, and tells someone when it fails.
A schedule is a few lines.
Lakeshore's Tech Desk marks late loans overdue each weekday at seven, before the desk opens. The schedule is a file the console can edit too, and the work is a script.
- The time zone is the campus's, so seven means seven, across daylight saving.
- Each loan that's newly late is announced once as an event, for anything that wants to send a reminder.
- How long a loan lasts is a variable the desk changes without a developer.
# Each weekday morning, before the desk opens.
schemaVersion: 1
body:
script: loans/mark-overdue
cron: 0 7 * * 1-5
timezone: America/Chicago A day in the life of an hourly job.
Fernhill texts owners about tomorrow's visits every hour. Most hours it takes a second. Some hours it doesn't, and those are the ones that matter.
- A slow run can make the next time skip, so two never text the same owner.
- When TextLine has an outage, pause the schedule with a reason. It stays paused through deploys until someone resumes it.
- A run that fails is retried as the script says, then someone is told.
What a bare cron leaves out.
Every line of this table is something teams usually find out about the hard way.
| Problem | What Volvel does |
|---|---|
| Time zones | Each workspace has one, and a schedule can name its own. A schedule keeps the zone it was made with. |
| Overlap | A flow's schedule skips a time while its last run is still going, unless told otherwise. A schedule of a script chooses for itself. |
| Pile-ups | A workspace with 200 runs waiting takes no more from its schedules until the queue shrinks, and the trigger says which times it passed over. |
| Retries | A limit, a delay and a backoff, set on the script. Each attempt is stopped at its timeout. |
| Failures | An alert to a chat or ticket endpoint, or a script of your own. Repeats within ten minutes are counted on the first alert, not sent again. |
| Knowing it ran | Every run kept with its output and logs, and a schedule that hasn't fired yet says "Not fired yet". |
| Testing safely | A new dev workspace and a clone start with their triggers paused, so a test schedule never runs beside production's. |
| Reaching the system | A script that names a worker pool runs on a worker inside the network that can reach the system it needs. |
One bad row doesn't stop the rest.
Every Monday at nine, Fernhill texts each owner with an invoice unpaid for two weeks. One phone number that's gone dead shouldn't stop the other forty.
- A ready-made step reads the invoices, with the date worked out in the flow itself.
- Four texts go out at a time, and a failure is marked on its item instead of failing the run.
- The last step counts what was looked at, texted and failed, so the run's output is the report.
weekly: trigger.schedule("0 9 * * 1", { timezone: "America/Los_Angeles" }),
find: step.script("core/table-read", {
inputs: {
table: "'invoices'",
filter: "{'and': [{'column': 'status', 'value': 'unpaid'}, …,
{'column': 'issued_on', 'op': 'lte',
'value': string(now - duration('336h')).substring(0, 10)}]}",
},
with: { tables: [invoices] },
}),
chase: step.foreach("steps.find.output.rows", {
script: chaseOne,
input: "{'invoice': item.id}",
concurrency: 4,
continueOnError: true,
}), Shortened from examples/fernhill.
Related
Move the cron jobs somewhere you can see them.
Schedules with time zones, pauses and a record of every run.