Schedule Node Agent Jobs with node-cron
Use node-cron to add recurring background jobs to Node.js agent services with overlap prevention, distributed coordination, background task isolation, and runtime inspection.
Prerequisites
Node.js 20 or newer, npm, node-cron package, a Node.js agent or automation service
Installation
Install or set up from the source-backed instructions:
Install with npm install node-cron, then import cron from 'node-cron' and define named schedules with options such as noOverlap, distributed, timezone, and background task file paths as needed.