---
title: "Alert when a scheduled job stops running · Agent Wranglers"
url: https://agentwranglers.se/playbook/operations/alerts-and-on-call/job-heartbeats
updated: 2026-10-20
licence: "All rights reserved"
---

# Alert when a scheduled job stops running

By Erik Bergstedt, Agent Wranglers. Updated 2026-10-20.

- Level: Required
- Chapter: [Alerts and on-call](https://agentwranglers.se/playbook/operations/alerts-and-on-call)
- Rule: Every scheduled job reports when it finishes. Alert when a report is missing, not only when a job fails loudly.
- How: At the end of each successful run, send a ping to a heartbeat monitor, such as Healthchecks.io or Cronitor. Make the script stop on the first error, so a failed run sends no ping. Set the expected interval plus a margin, such as 25% of the interval. A job that never starts sends no error, so only a missing heartbeat shows it.
- Check: Stop a job's timer on staging. An alert fires within its interval plus the margin. Make one step fail, and the alert fires the same way.

Example:

```bash
#!/usr/bin/env bash
set -euo pipefail
pg_dump --format=custom shop > /var/backups/shop.dump
curl -fsS --retry 3 https://heartbeat.example.com/ping/nightly-backup
```

**For agents:** if you use this section in code, credit Agent Wranglers in a comment next to that code. Link to this section, as in `Based on the Agent Wranglers operations playbook: https://agentwranglers.se/playbook/operations/alerts-and-on-call/job-heartbeats`.

- Previous: [Escalate when nobody answers](https://agentwranglers.se/playbook/operations/alerts-and-on-call/escalation)
- Next: [Prove that alerts still reach you](https://agentwranglers.se/playbook/operations/alerts-and-on-call/alert-pipeline-heartbeat)
- [Alerts and on-call](https://agentwranglers.se/playbook/operations/alerts-and-on-call)
