Guides/Tutorials

How to Monitor Cron Jobs in Node.js (node-cron & beyond)

Updated June 14, 2026 5 min read

Node.js apps schedule work in many ways — an in-process node-cron, a BullMQ repeatable job, Agenda, or a plain OS cron calling a script. All share the same blind spot: when the schedule breaks, nothing tells you. A heartbeat ping closes that gap.

node-cron

Wrap the job body and ping on success and failure:

import cron from 'node-cron';

const BASE = 'https://api.cronguard.dev/v1/ping/<your-uuid>';
const ping = (s = '') => fetch(BASE + s).catch(() => {});

cron.schedule('0 3 * * *', async () => {
  await ping('/start');
  try {
    await runBackup();
    await ping();        // success
  } catch (err) {
    await ping('/fail');
    throw err;
  }
});

Plain cron calling a Node script

0 3 * * * /usr/bin/node /app/backup.js && curl -fsS https://api.cronguard.dev/v1/ping/<your-uuid>

BullMQ repeatable jobs

Ping inside the worker processor, or use the completed and failed queue events to ping centrally:

worker.on('completed', () => fetch('https://api.cronguard.dev/v1/ping/<your-uuid>').catch(() => {}));
worker.on('failed', () => fetch('https://api.cronguard.dev/v1/ping/<your-uuid>/fail').catch(() => {}));
In-process schedulers like node-cron only run while the process is alive. If the process crashes or is never restarted after a deploy, the jobs vanish silently — exactly what an external heartbeat catches.

Alerts that wake you up

Send those pings to CronGuard, set the expected interval, and get instant alerts over SMS, WhatsApp, Slack, Telegram or email when a Node job misses its window — plus execution-time tracking. Free to start, nothing to install.

Stop losing sleep over silent failures

CronGuard alerts you within minutes when a scheduled job fails to check in. No agent to install. Free to start.

Start Monitoring Free