Templates / Monitor workflow heartbeats with Google Sheets and Slack alerts

Monitor workflow heartbeats with Google Sheets and Slack alerts

Ready for 3.0

by Akash Narayan ✓ · 7 views · created 2026-08-07 · DevOps

Ready for 3.0. This template uses no nodes that n8n 3.0 removes. No removed nodes, versions or helpers found. Static check, last run 2026-10-19.

Nodes used (11)

Google SheetsSlack

What it does

Quick overview This workflow implements a dead man’s switch for scheduled jobs by recording heartbeat check-ins via a web-hook to Google Sheets and alerting to Slack when a job misses its expected run window, with optional recovery notifications when the job starts checking in again. How it works 1. Receives a POST webhook heartbeat containing a jobid and validates an x-heartbeat-secret header against a configured shared secret. 2. Looks up the jobid in a Google Sheets “jobs” registry and returns a 404 response if the job is not registered. 3. Updates the matching Google Sheets row with the current lastheartbeat timestamp, sets status to OK, and clears lastalertat. 4. If the job was previously in an alerting state, posts a recovery message to the configured Slack channel. 5. Responds to the heartbeat request with a 200 JSON confirmation including the jobid and recorded timestamp. 6. Every 15 minutes, loads all active jobs from Google Sheets and calculates which ones are overdue based on expectedeveryminutes plus a grace period, suppressing repeat alerts for a configured re-alert window. 7. For each overdue job, posts a missed-run (or never-seen) alert to Slack and writes back lastalertat and status in Google Sheets to prevent immediate re-alerting. Setup 1. Create or copy a Google Sheets document with a “jobs” sheet containing columns such as jobid, jobname, expectedeveryminutes, graceminutes, lastheartbeat, status, lastalertat, active, and alertchannel. 2. Add Google Sheets OAuth2 credentials and replace YOURSHEETID in all Google Sheets steps with your spreadsheet ID. 3. Add Slack credentials and set the target channel (or use per-row alertchannel) in the Slack alert and recovery message steps. 4. Set a strong sharedsecret in the receiver configuration and have each monitored job send it in the x-heartbeat-secret header when POSTing to the webhook. 5. Add one row per monitored job (set active to TRUE, expectedeveryminutes, and optional graceminutes/alertchannel) and configure your jobs to POST their jobid to the webhook URL on successful completion. Requirements - Google Sheets account with edit access, used as the job registry and heartbeat log - Slack workspace with a bot/app that can post to the alert channel(s) - Each monitored job needs to be able to send an HTTP POST request on completion (a script, a cron job, or another n8n workflow) - A self-hosted or cloud n8n instance that can receive inbound webhooks Customization - Swap Slack for email, Telegram, Discord, or PagerDuty by replacing the two Slack nodes - Move the registry from Google Sheets to Airtable or Postgres if job volume outgrows a spreadsheet - Adjust defaultgraceminutes and realertafterminutes in "Set checker config" to tune alert sensitivity and repeat-alert frequency - Set a per-row alertchannel in the sheet to route different jobs to different Slack channels - Change the schedule trigger's interval (default 15 minutes) to check more or less often Additional info The webhook is public by design, since any job can POST a heartbeat to it. The sharedsecret check in "Validate shared secret" isn't optional hardening, it's the only thing stopping a stranger from spoofing check-ins and silencing your alerts. Treat it like an API key.

View the original on n8n.io → Check your own copy

Get the weekly “what broke” email

New templates, newly broken ones, and n8n release changes. One short email a week.

Form not loading? Subscribe here.