Skip to content
Agents tracked: 506 Releases (7d): 634 Agent status: 3 with issuesSince last limit reset: Claude 15d · Codex 0d For AI agents: Markdown Updated Nov 26, 2026

node-cron

Job scheduling for Node.js with overlap prevention and distributed coordination.

Jobs, queues and workflowsNPM

GitHubWebsite

1. License

License from npm.

github.com/node-cron/node-cron

From the package registry and GitHub, checked daily. Tap a verdict to see its source.How we checkedReport an error

What node-cron does

node-cron is a zero-dependency, in-process cron scheduler. It adds one-flag overlap skipping, one-instance-per-fire coordination across replicas, and forked background tasks, and its own docs say plainly that it does not persist state and is not a job queue.

node-cron popularity

62 / 100
Gid Score, #873 overall
7.2M
downloads a week, npm
3,286
GitHub stars
38
agent projects use it
node-cron: downloads per weeknpm, node-cron 7,151,932
node-cron: GitHub starsnode-cron/node-cron 3,286

Gid Score measures public popularity and activity, not quality. How the Gid Score is calculated

How node-cron is used

  • node-cron is a dependency in 38 of the 6,258 public GitHub projects set up for AI coding agents that we scanned (0.8% of the 4,867 JavaScript/TypeScript ones), #3 of 48 in jobs, queues and workflows.
  • Counting the projects our scan samples by dependency (Solana 3,067, Ethereum and EVM 1,774, 3D and games 3,130, agent frameworks and SDKs 13,750), it appears in 194; those are left out of every share on this page.
  • The most used alternative in our scan is Croner (45 projects).
  • Projects that use it most often also use dotenv (86.8%), uuid (55.3%), Express (55.3%).

By coding agent

25 projects, 0.8%
17 projects, 0.6%
13 projects, 0.5%
6 projects, 1.8%
6 projects, 2.2%
5 projects, 1.1%

Often used with

In 86.8% of its projects
In 55.3% of its projects
In 55.3% of its projects
In 47.4% of its projects
In 52.6% of its projects
In 65.8% of its projects
In 39.5% of its projects
In 39.5% of its projects

node-cron in practice

Strengths

Overlap skipping is a single option

Set <code>noOverlap: true</code> and a tick that fires while the previous run is still active is skipped, not stacked. The site describes it as needing no custom locking. Skipped runs emit <code>execution:overlap</code>.

One run per fire across replicas

With <code>distributed: true</code>, each scheduled fire runs on one instance. By default this uses an env-var flag (<code>NODE_CRON_RUN</code>, per the docs index). A Redis coordinator is available for high availability.

Heavy jobs move to a forked process

Pass a path such as <code>'./tasks/backup.js'</code> instead of a function, and node-cron runs the job in a separate forked process. Background tasks use the same task interface and events as inline ones.

Richer cron syntax than five plain fields

Expressions accept an optional seconds field, plus <code>L</code>, <code>L-n</code>, <code>W</code>, <code>#</code> and <code>?</code>. Inverted ranges such as <code>22-2</code> wrap around the field.

Watch out for

Not durable

Schedules live in process memory. The maintainers say node-cron does not persist state, and they recommend a queue or workflow engine when you need exactly-once guarantees across crashes.

Missed runs are not replayed

v4 removed <code>recoverMissedExecutions</code>. A missed run only emits <code>execution:missed</code> and logs a warning. Any catch-up logic is yours to write.

Bundlers break background tasks

Background tasks fork a helper file from <code>node_modules</code>. If you bundle without marking node-cron external, the fork fails with <code>Cannot find module '.../daemon.js'</code>. Inline function tasks are not affected.

Control and inspect a scheduled task

const task = cron.schedule('0 3 * * *', doWork, {
  name: 'nightly-backup',
  timezone: 'America/Sao_Paulo',
});

task.stop();       // pause
task.start();      // resume
task.destroy();    // remove permanently

task.getStatus();  // 'stopped' | 'idle' | 'running' | 'destroyed'
task.getNextRun(); // next scheduled Date, or null
task.lastRun();    // { date, result } or { date, error }, or null

More about node-cron

Funding
  • GitHub Sponsors: https://github.com/node-cron
  • Open Collective: https://opencollective.com/node-cron

See all

Packages around it
  • dotenv: Loads .env files
  • axios: HTTP client
  • express: Web server framework
  • ts-node: Runs TypeScript in Node
  • @solana/spl-token: Solana token program client
  • cors: CORS middleware
More in Jobs, queues and workflows

Alternatives

node-cron This page

ISCGid 627.2M/wk

Croner

JavaScript cron expression parser and task scheduler with no dependencies, for all environments.

MITGid 6216.7M/wk

BullMQ

Fast, reliable Redis-backed queue for jobs and messages in Node.js.

MITGid 6713.9M/wk

cron

Runs cron jobs in Node.js.

MITGid 5910M/wk

Compare node-cron with another tool

Get started

Install it.

npm install node-cron

Rules for your agent

Paste into AGENTS.md or CLAUDE.md
## node-cron
- Target v4: it requires Node.js 20+. Use `task.execute()`, not `task.now()`. Do not pass `scheduled`, `runOnInit` or `recoverMissedExecutions`; v4 removed them.
- `cron.schedule` starts the task immediately. When the task should start later, use `cron.createTask` with the same arguments and call `.start()` yourself.
- Listen for `execution:finished` and `execution:failed`, not the v3 `task-done` event. Listeners receive a `TaskContext`.
- Add `noOverlap: true` for jobs that can outlast their interval. Add `distributed: true` plus a `name` when the app runs on several instances.
- For background tasks (a file path instead of a function) in a bundled app, mark node-cron as external (`--external:node-cron`). The `logger` option is not supported for background tasks.
- Use `timezone: 'UTC'` when a fixed interval must keep firing across DST changes.
- Do not use node-cron when you need durable queues, retries, or exactly-once runs across crashes. It does not persist state.