← Back to Docs

Heartbeat Monitoring for Cron Jobs

A heartbeat monitor watches a job that runs somewhere else: a crontab line, a GitHub Actions workflow, a backup script, a worker on your own server. The job requests a secret URL when it finishes. If that request doesn't arrive on time, RunLater alerts you. It catches the failures a job can't report itself: a crash, a hang, a server that is off, a cron daemon that stopped.

Set one up

  1. Open Heartbeats in the dashboard and create one. Pick how often the job runs and a grace time: how late a ping can be before you hear about it.
  2. Copy its ping URL, https://runlater.app/api/ping/<token>. Anyone with the URL can ping it, so treat it like a password.
  3. Request the URL at the end of the job. GET, POST and HEAD all work.
# crontab: ping on success, /fail on failure
0 3 * * * /usr/local/bin/backup.sh && curl -fsS -m 10 --retry 3 https://runlater.app/api/ping/TOKEN || curl -fsS -m 10 https://runlater.app/api/ping/TOKEN/fail
# GitHub Actions: last step of the job
- name: Heartbeat
  if: always()
  run: curl -fsS -m 10 "https://runlater.app/api/ping/${{ secrets.HEARTBEAT_TOKEN }}${{ job.status != 'success' && '/fail' || '' }}"

When you are alerted

  • Late: no ping within the period plus the grace time since the last one.
  • Failed: the job requested /fail. This alerts right away.
  • Back up: the next normal ping after either. You get one "up again" message.

Alerts go to every member of the workspace by email, and to the Slack, Discord or webhook URLs under Settings, Failure alerts. Webhook URLs receive a JSON body with event set to heartbeat.down or heartbeat.up. A new heartbeat waits for its first ping before it can go down, and a paused one never alerts.

To show the job's health to your team or users, turn on Public status page and badge in its details. You get a page with its recent pings and a badge for a README; neither shows the ping URL.

Picking the grace time

Set it to the longest a normal run can take plus a little slack. A nightly backup that takes 20 to 40 minutes, scheduled daily, with a 1 hour grace, alerts by 4:00 if the 3:00 run never finished. The checker runs every minute.

Limits

  • 20 heartbeats on Starter, 100 on Team, 500 on Pro. Pings don't count as runs.
  • Up to 60 pings a minute per heartbeat; the last 50 are kept.
  • Period from 1 minute to 31 days, grace from 1 minute to 7 days.

For jobs that only call a URL, you don't need a heartbeat: let RunLater make the call on your schedule, and it retries and alerts on its own. See cron jobs as a service.

Frequently asked questions

What is a heartbeat monitor?

A URL your job requests every time it finishes. If the request does not arrive within the expected period plus a grace time, the monitor goes down and you are alerted. It catches jobs that crash, hang or never start.

How do I report a failure instead of waiting for a missed ping?

Request the ping URL with /fail on the end. The heartbeat goes down right away, and the next normal ping brings it back up.

How many heartbeats come with a plan?

Starter includes 20, Team 100 and Pro 500. They are separate from scheduled requests and pings do not count as runs.

Does a RunLater deploy cause false alerts?

No. Pings sent while RunLater restarts can be lost, so the checker never counts time before its own last start when deciding a ping is late.

Set this up in a few minutes

Paste the URL, pick a time or a cron schedule, and RunLater sends the request, retries it if it fails, and keeps the response.

Start a 14-day trialStarter is $15/month for 250 scheduled requests and 25,000 runs. Cancel before day 14 and you pay nothing.