Method

Heartbeat monitoring: watching a script, a cron job or a Zap

A heartbeat reverses the logic of alerting: you are warned when a message does not arrive. Principle, setup and limits.

By Abdellah El Kharraze · · 2 min read

Key takeaways
  • A heartbeat is an HTTP call sent on every successful run.
  • If the signal does not arrive within the expected delay, an alert goes out.
  • It works for anything that can make an HTTP call.
  • It measures neither volume nor duration, and must be added to every job.

A heartbeat is an HTTP call that a job sends to a monitoring service every time it finishes correctly. The service knows the expected rhythm. If the signal is missing, it alerts. It is also called a dead man's switch: the absence of a message is what triggers the alarm.

When to use it

  • A backup script launched every night by cron.
  • A Zap or an automation on a platform with no monitoring API.
  • A scheduled task inside a business application.
  • A critical workflow for which you want a second proof of life.

Setting it up

Add, as the last step of the job, an HTTP call to the address provided by your monitoring service. Put it right at the end: a signal sent at the start proves the job began, not that it succeeded. Then set the expected delay with a margin: for a daily job, twenty-six hours rather than twenty-four.

The limits

  • You have to add and maintain it in every job.
  • It says “I ran”, not “I handled the right volume”.
  • If the job succeeds without processing anything, the signal is sent anyway.

Heartbeat or API polling?

For n8n and Make, reading the API is preferable: nothing to change in your workflows, and you also get volume, duration and active status. The heartbeat remains the right answer for everything else. Nokto combines both in the same console, with the same silence rules. See the features.

Frequently asked questions

How much margin should I allow on the delay?

Between 10 and 50% of the normal interval, depending on how regular the job is. Too tight and you get false alerts; too loose and you are warned late.

AE
Abdellah El Kharraze

Founder of Nokto and Owepo, based in Nice, France. Network and security engineer for large enterprises until 2016, then ten years building n8n and Make automations for small businesses.

Your first monitored workflow in ten minutes.

Connect an n8n instance or a Make team: Nokto discovers your workflows, learns their rhythm and warns you at the first anomaly.

14 days free · no credit card · cancel anytime