Architecture

Scheduled job (cron)

Work a system runs by itself at set times, such as nightly roll-ups or hourly reminders, rather than in response to a user.

Updated October 2026 · with examples from our own builds

What does scheduled job mean in practice?

Most products have work nobody clicks for: expiring bookings, sending reminders, settling earnings, publishing a scheduled post, cleaning up old data. A scheduler runs each of these on a timetable, from every few seconds to once a day.

Two failures matter: a job that runs twice, and one that stops without anyone noticing. When a backend runs several processes or servers, a naive scheduler starts in each of them and publishes the same post several times. When a job silently stops, reminders go quiet until a customer complains.

Sound schedulers give each job one owner, claim each run atomically and leave a record of what ran and when.

Scheduled job at a glance

Typical jobs
Expiries, reminders, settlements, reports and clean-ups
Classic bug
The same job running once per server process
Ask for
A record of every run and an alert when one fails

Where has scheduled job come up in our builds?

The API runs in Node cluster mode, so the daily AI blog scheduler starts only in the master process, and each day's run must also win an atomic MongoDB update on the date of the last run. On a local database a second tick on the same day did nothing. Built and tested; not yet switched on at protonfit.com.
Proton Fitness Academy
The phone backend owns every timer: the dispatch tick every 10 seconds, booking requests expiring each minute, the hourly welfare-map rebuild, and daily sweeps for document expiry, wallet reconciliation and account erasure. With one owner per job, no job runs twice.
EverybodysPet (built, not deployed)
The mobile backend runs nine scheduled jobs for subscriptions, attendance, check-ins and settlement.
Trainr

Common questions about scheduled job

Why did my scheduled email go out twice?

Usually because the scheduler started in more than one server process. Each run should be claimed atomically, so the first process to claim it does the work and the rest stop.

Which time zone should scheduled jobs run in?

Compare and store in UTC, then convert for people. Proton's blog claims each run by UTC date, while the posting hour is picked within Indian daytime.

Related terms

Planning a product and not sure where scheduled job fits? Ask us, or browse all 116 terms in the glossary.