Node cron generator
Build node-cron expressions for JavaScript jobs. Preview the schedule, copy the expression, and understand which jobs need timezone handling.
Build node-cron expressions for JavaScript jobs. Preview the schedule, copy the expression, and understand which jobs need timezone handling.
The expression */15 * * * * runs every 15 minutes. It is sensible for lightweight polling, cache refreshes, queue cleanup, or a recurring sync that can tolerate small delays. It is not a good choice for heavyweight jobs unless you have locking, backoff, and monitoring in place. If the previous run can still be active when the next one starts, add a guard so you do not create overlapping work.
import cron from 'node-cron';
cron.schedule('*/15 * * * *', () => {
// run task
}, {
timezone: 'Europe/London'
});
The common failure is assuming node-cron behaves like a managed scheduler. It runs inside your app process, so deploys, crashes, autoscaling, and server restarts all matter. In multi-instance deployments, each instance may run the same schedule unless you use a leader, queue, lock, or external scheduler. For jobs that send money, emails, reminders, or destructive updates, write the task so it can be safely retried.
# Every 15 minutes */15 * * * * # Every day at 06:00 0 6 * * * # Monday to Friday at 17:30 30 17 * * 1-5
Paste the expression into the main builder and check the next run times. Then run the callback manually in a development script before relying on the schedule. Log the start, result, and duration of each run. For production systems, add an alert if the job has not completed within the expected window, because silent cron failures are usually discovered too late.
Does node-cron keep running after a deploy? Only if the process is running. Restarts, crashed workers, and scaled deployments all affect scheduled jobs.
Can multiple app instances run the same job? Yes. If your app runs on several instances, use locking, a queue, or a single scheduler process.
Should I set a timezone? Set one whenever the job is tied to a human expectation, such as local reports, reminders, invoices, or office-hours tasks.
Open the Cron Expression Builder to edit this schedule, explain a pasted expression, and preview upcoming run times.
Every 5 minutesEvery hourGitHub Actions guideCron not running?