n8n Guides
n8ntelegramalert

Get a Telegram alert when an endpoint goes down

Who this is for: anyone who wants to be notified ON THEIR PHONE when a site/API stops responding, without subscribing to a monitoring service and without getting a message every 5 minutes until it's fixed.

The problem with repeated messages

A naive workflow that sends a message on every failed check floods your Telegram with identical notifications. This workflow keeps the last known state in memory (with $getWorkflowStaticData, the workflow's internal storage) and sends a message only when the state changes: from online to offline, and from offline to online.

Procedure

  1. Create a Telegram bot with @BotFather and save the token.
  2. Message the bot (or add it to a group/channel) and get your chat_id by calling https://api.telegram.org/bot<TOKEN>/getUpdates.
  3. Download alert-telegram-endpoint-down.json and import it into n8n (Workflows → Import from File).
  4. In the Controlla endpoint node, set the URL to monitor.
  5. In the Invia alert Telegram node, replace YOUR_BOT_TOKEN in the URL and YOUR_CHAT_ID in the body with your values.
  6. Activate the workflow.

How it works

The HTTP Request node has onError: continueErrorOutput: if the request fails (timeout, connection refused, 5xx) it exits through the second output instead of blocking the workflow. Two Set nodes mark the result as isUp: true/false, a Code node compares it against the last saved state, and only if it changed does it reach the Telegram node.

Actually tested: run on n8n against an endpoint that refused the connection and then against a live site. The state change was correctly detected and the Telegram message arrived: "✅ Endpoint tornato ONLINE", confirmed by the Telegram API response ("ok": true).

Don't have a basic check workflow yet? Start with How to monitor if a site is online with n8n.