Quick overview
This workflow runs every five minutes to check a configured health URL and sends a Telegram alert when the endpoint returns an HTTP error status.
How it works
- Runs every 5 minutes on a schedule.
- Loads the target URL, service name, and Telegram chat ID from a configuration step.
- Sends an HTTP request to the URL with a 10-second timeout and captures the full response without failing the workflow on errors.
- Checks whether the HTTP status code is greater than 399.
- Sends a Markdown-formatted Telegram message with the service name, status code, URL, and check timestamp when the status indicates a failure.
- Ends silently without sending anything when the status indicates the service is up.
Setup
- Create a Telegram bot with BotFather and add your Telegram bot token as an n8n Telegram credential.
- Update the URL, service name, and Telegram chat ID in the configuration step (or map them to the HTTP_URL, SERVICE_NAME, and TELEGRAM_CHAT_ID environment variables).
- Select your Telegram credential in the Telegram alert step and activate the workflow.
Requirements
- n8n (self-hosted or cloud - built and tested on 2.35.x) and a Telegram bot token from BotFather.
Customization
- Change the interval on the Schedule Trigger, add more items to the Config node to monitor several services at once, or replace the Telegram node with Slack, Discord or email.
Additional info
Also published as a free, MIT-licensed workflow with setup notes at https://github.com/gregorymammone-coder/n8n-uptime-telegram-alert