{
 "kind": "tool",
 "slug": "node-cron",
 "path": "tools/node-cron/",
 "name": "node-cron",
 "maker": null,
 "density": "profile",
 "crumbs": [
  [
   "Tools",
   "tools/"
  ],
  [
   "Jobs, queues and workflows",
   "tools/jobs-workflows/"
  ]
 ],
 "lead": "Job scheduling for Node.js with overlap prevention and distributed coordination.",
 "chips": [
  {
   "label": "Jobs, queues and workflows",
   "path": "tools/jobs-workflows/"
  },
  {
   "label": "NPM"
  }
 ],
 "primary": {
  "label": "Copy install command",
  "copy": "npm install node-cron"
 },
 "links": [
  {
   "label": "GitHub",
   "href": "https://github.com/node-cron/node-cron"
  },
  {
   "label": "Website",
   "href": "https://nodecron.com"
  }
 ],
 "track": "New versions, deprecation and license changes on your dashboard",
 "verdicts": [
  {
   "key": "license",
   "label": "License",
   "value": "ISC",
   "status": "yes",
   "sub": "Use it in paid apps",
   "quote": null,
   "note": "License from npm.",
   "src": "https://github.com/node-cron/node-cron"
  },
  {
   "key": "maint",
   "label": "Maintained",
   "value": "Maintained",
   "status": "yes",
   "sub": "Last change Nov 7, 2026",
   "note": "Latest GitHub release Jul 5, 2026. ",
   "src": "https://github.com/node-cron/node-cron"
  },
  {
   "key": "pop",
   "label": "Used by agents' projects",
   "value": "38 projects",
   "status": "info",
   "sub": "#3 of 48 in its category",
   "note": "Dependency in 38 public GitHub projects set up for AI coding agents that we scanned (0.6%).",
   "src": null
  },
  {
   "key": "agent",
   "label": "Agent access",
   "value": "Docs for agents",
   "status": "yes",
   "sub": "llms.txt",
   "note": "Agent skills for this library in the skills catalog; community skills are written by others, read them before you install.",
   "src": "https://nodecron.com/llms.txt"
  }
 ],
 "vfoot": "From the package registry and GitHub, checked daily.",
 "blocks": [
  {
   "id": "overview",
   "nav": "Overview",
   "h2": "What node-cron does",
   "parts": [
    {
     "t": "prose",
     "text": "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."
    }
   ]
  },
  {
   "id": "popularity",
   "nav": "Popularity",
   "h2": "node-cron popularity",
   "parts": [
    {
     "t": "stats",
     "items": [
      {
       "n": "62",
       "of": "/ 100",
       "l": "Gid Score, #873 overall"
      },
      {
       "n": "7.2M",
       "l": "downloads a week, npm"
      },
      {
       "n": "3,286",
       "l": "GitHub stars"
      },
      {
       "n": "38",
       "l": "agent projects use it"
      }
     ]
    },
    {
     "t": "small",
     "text": "Gid Score measures public popularity and activity, not quality.",
     "link": "How the Gid Score is calculated",
     "path": "tools/top/"
    }
   ]
  },
  {
   "id": "usage",
   "nav": "How it is used",
   "h2": "How node-cron is used",
   "parts": [
    {
     "t": "list",
     "items": [
      "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%)."
     ]
    },
    {
     "t": "h3",
     "text": "By coding agent"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "25 projects, 0.8%",
       "v": "Claude Code",
       "path": "agents/claude-code/"
      },
      {
       "l": "17 projects, 0.6%",
       "v": "GitHub Copilot",
       "path": "agents/github-copilot/"
      },
      {
       "l": "13 projects, 0.5%",
       "v": "Cursor",
       "path": "agents/cursor/"
      },
      {
       "l": "6 projects, 1.8%",
       "v": "OpenClaw",
       "path": "agents/openclaw/"
      },
      {
       "l": "6 projects, 2.2%",
       "v": "Devin Desktop",
       "path": "agents/devin-desktop/"
      },
      {
       "l": "5 projects, 1.1%",
       "v": "Gemini CLI",
       "path": "agents/gemini-cli/"
      }
     ]
    },
    {
     "t": "h3",
     "text": "Often used with"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "In 86.8% of its projects",
       "v": "dotenv",
       "path": "tools/dotenv/"
      },
      {
       "l": "In 55.3% of its projects",
       "v": "uuid",
       "path": "tools/uuid/"
      },
      {
       "l": "In 55.3% of its projects",
       "v": "Express",
       "path": "tools/express/"
      },
      {
       "l": "In 47.4% of its projects",
       "v": "cors",
       "path": "tools/cors/"
      },
      {
       "l": "In 52.6% of its projects",
       "v": "tsx",
       "path": "tools/tsx/"
      },
      {
       "l": "In 65.8% of its projects",
       "v": "Zod",
       "path": "tools/zod/"
      },
      {
       "l": "In 39.5% of its projects",
       "v": "ws",
       "path": "tools/ws/"
      },
      {
       "l": "In 39.5% of its projects",
       "v": "Axios",
       "path": "tools/axios/"
      }
     ]
    }
   ]
  },
  {
   "id": "profile",
   "nav": "Profile",
   "h2": "node-cron in practice",
   "parts": [
    {
     "t": "h3",
     "text": "Strengths"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "Overlap skipping is a single option",
       "v": "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>."
      },
      {
       "l": "One run per fire across replicas",
       "v": "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."
      },
      {
       "l": "Heavy jobs move to a forked process",
       "v": "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."
      },
      {
       "l": "Richer cron syntax than five plain fields",
       "v": "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."
      }
     ]
    },
    {
     "t": "h3",
     "text": "Watch out for"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "Not durable",
       "v": "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."
      },
      {
       "l": "Missed runs are not replayed",
       "v": "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."
      },
      {
       "l": "Bundlers break background tasks",
       "v": "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."
      }
     ]
    },
    {
     "t": "h3",
     "text": "Control and inspect a scheduled task"
    },
    {
     "t": "tabs",
     "label": "Example",
     "items": [
      {
       "tab": "Javascript",
       "code": "const task = cron.schedule('0 3 * * *', doWork, {\n  name: 'nightly-backup',\n  timezone: 'America/Sao_Paulo',\n});\n\ntask.stop();       // pause\ntask.start();      // resume\ntask.destroy();    // remove permanently\n\ntask.getStatus();  // 'stopped' | 'idle' | 'running' | 'destroyed'\ntask.getNextRun(); // next scheduled Date, or null\ntask.lastRun();    // { date, result } or { date, error }, or null"
      }
     ]
    }
   ]
  },
  {
   "id": "more",
   "nav": null,
   "spy_as": "profile",
   "h2": "More about node-cron",
   "parts": [
    {
     "t": "more",
     "items": [
      {
       "title": "Funding",
       "path": "tools/funding/",
       "items": [
        "GitHub Sponsors: https://github.com/node-cron",
        "Open Collective: https://opencollective.com/node-cron"
       ]
      },
      {
       "title": "Packages around it",
       "items": [
        "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"
       ]
      },
      {
       "title": "More in Jobs, queues and workflows",
       "path": "tools/jobs-workflows/",
       "items": [
        {
         "text": "APScheduler",
         "path": "tools/apscheduler/"
        },
        {
         "text": "Celery",
         "path": "tools/celery/"
        },
        {
         "text": "croniter",
         "path": "tools/croniter/"
        },
        {
         "text": "Inngest",
         "path": "tools/inngest/"
        },
        {
         "text": "schedule",
         "path": "tools/schedule/"
        },
        {
         "text": "Socket.IO Redis Adapter",
         "path": "tools/socket-io-redis-adapter/"
        },
        {
         "text": "p-queue",
         "path": "tools/p-queue/"
        },
        {
         "text": "Workflow DevKit",
         "path": "tools/workflow/"
        }
       ]
      }
     ]
    }
   ]
  },
  {
   "id": "alternatives",
   "nav": "Alternatives",
   "h2": "Alternatives",
   "parts": [
    {
     "t": "alts",
     "items": [
      {
       "name": "node-cron",
       "me": true,
       "facts": [
        "ISC",
        "Gid 62",
        "7.2M/wk"
       ]
      },
      {
       "name": "Croner",
       "why": "JavaScript cron expression parser and task scheduler with no dependencies, for all environments.",
       "path": "tools/croner/",
       "facts": [
        "MIT",
        "Gid 62",
        "16.7M/wk"
       ]
      },
      {
       "name": "BullMQ",
       "why": "Fast, reliable Redis-backed queue for jobs and messages in Node.js.",
       "path": "tools/bullmq/",
       "facts": [
        "MIT",
        "Gid 67",
        "13.9M/wk"
       ]
      },
      {
       "name": "cron",
       "why": "Runs cron jobs in Node.js.",
       "path": "tools/cron/",
       "facts": [
        "MIT",
        "Gid 59",
        "10M/wk"
       ]
      }
     ],
     "more": "Compare node-cron with another tool",
     "more_path": "tools/compare/"
    }
   ]
  },
  {
   "id": "start",
   "nav": "Get started",
   "h2": "Get started",
   "parts": [
    {
     "t": "install",
     "intro": "Install it.",
     "code": "npm install node-cron"
    },
    {
     "t": "h3",
     "text": "Rules for your agent"
    },
    {
     "t": "rules",
     "label": "Paste into AGENTS.md or CLAUDE.md",
     "text": "## node-cron\n- Target v4: it requires Node.js 20+. Use `task.execute()`, not `task.now()`. Do not pass `scheduled`, `runOnInit` or `recoverMissedExecutions`; v4 removed them.\n- `cron.schedule` starts the task immediately. When the task should start later, use `cron.createTask` with the same arguments and call `.start()` yourself.\n- Listen for `execution:finished` and `execution:failed`, not the v3 `task-done` event. Listeners receive a `TaskContext`.\n- Add `noOverlap: true` for jobs that can outlast their interval. Add `distributed: true` plus a `name` when the app runs on several instances.\n- 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.\n- Use `timezone: 'UTC'` when a fixed interval must keep firing across DST changes.\n- Do not use node-cron when you need durable queues, retries, or exactly-once runs across crashes. It does not persist state.\n"
    }
   ]
  }
 ],
 "glance": [
  [
   "Package",
   "npm node-cron"
  ],
  [
   "Category",
   "Jobs, queues and workflows"
  ],
  [
   "License",
   "ISC"
  ],
  [
   "Latest version",
   "v4.6.0, July 5, 2026"
  ],
  [
   "On GitHub since",
   "February 2016"
  ],
  [
   "Gid Score",
   "61.9"
  ],
  [
   "Rank in category",
   "#3 of 48"
  ],
  [
   "GitHub",
   "node-cron/node-cron"
  ],
  [
   "Last change",
   "Nov 7, 2026"
  ]
 ],
 "good": [],
 "checked_line": "From the package registry, GitHub and our scan of public agent projects; numbers update daily.",
 "logo": "https://agentgid.com/media/avatars/node-cron.png"
}