Quick overview
This workflow runs on a frequent schedule to check UptimeRobot monitor status and a Google PageSpeed Insights test, logs monitor data to Google Sheets, and sends uptime or downtime notifications via Gmail, Telegram, and WhatsApp (Rapiwa), with alert text optionally rewritten by Anthropic Claude.
How it works
- Runs on a schedule trigger at a minute-based interval.
- Fetches all monitors from UptimeRobot, then writes monitor details to Google Sheets and filters to a specific status value for additional handling.
- Builds an alert payload that lists only monitors marked “May Be Down” or “Down” (excluding one hard-coded monitor ID) and sets a server_down flag.
- If server_down is true, sends the alert text to Anthropic Claude to generate a friendlier message, escapes newlines for compatibility, and sends the alert via WhatsApp (Rapiwa), Gmail, and Telegram.
- If server_down is false, sends an “OK” notification via WhatsApp (Rapiwa), Gmail, and Telegram.
- In parallel, calls the Google PageSpeed Insights API for a target URL, formats any “May Be Down/Down” findings into a second alert payload, and routes it through the same down/ok notification logic.
Setup
- Add credentials for UptimeRobot API, Google Sheets OAuth2, Anthropic API, Gmail OAuth2, Telegram Bot API, and Rapiwa (WhatsApp) API.
- Update the Google Sheets document ID and sheet name to your own spreadsheet (and ensure it has columns matching the monitor fields, with “id” used for matching).
- Replace the placeholder WhatsApp number, email recipient address, and Telegram chat ID with your real destinations.
- Update the Google PageSpeed Insights request with your target URL and a valid API key.
- Adjust the excluded UptimeRobot monitor ID and the timezone in the message-formatting scripts if they don’t match your environment.