Statuspage maintenance alerts in Slack, logged to Sheets

By General Input

Every weekday morning your team gets a Slack heads-up about planned maintenance starting in the next 24 hours, plus a running log in Google Sheets.

Integrations

  • Statuspage
  • Slack Bot
  • Google Sheets

Type

Deterministic Code

Categories

  • Operations
  • Engineering

Every weekday at 8am, check Statuspage for maintenance windows that are about to start, so nobody on the team gets surprised by planned downtime. Run this on a cron trigger, weekdays only, at 8am in our local timezone.

First, pull the planned maintenance from Statuspage using both the "Get a list of scheduled incidents" and the "Get a list of upcoming incidents" operations for our page id. These list endpoints are offset paginated with page and limit, where limit maxes out at 100, and they return bare JSON arrays with no cursor, so advance page until an empty array comes back. Statuspage allows only 1 request per second and returns HTTP 420 when that is exceeded, so space the calls out and retry after a pause if a 420 comes back. Merge the results from both operations and dedupe by incident id, since the same maintenance can appear in both lists.

Scheduled maintenances share the incident resource with realtime incidents, and they use the statuses scheduled, in_progress, verifying and completed. Filter to the ones whose scheduled_for timestamp falls between now and 24 hours from now, and keep only those still in the scheduled status, so completed or already running windows do not get announced as upcoming. Sort what remains by start time, earliest first.

Format each remaining window as one entry showing its name, its start and end time converted from UTC into our local timezone in a readable format such as "Tue 12 Aug, 2:00pm to 4:00pm", and the names of the components it affects. Post that formatted list into our engineering channel using the Slack Bot "Send a Message" action, with a short header line saying how many maintenance windows are starting in the next 24 hours. If the filtered list is empty, skip the Slack post entirely rather than sending an empty message.

Then append one row per maintenance window to a Google Sheets log using the "Append Values" action, so we keep a running record of planned downtime for audit and reporting. Use these columns in order: date the alert ran, maintenance name, start time in local timezone, end time in local timezone, affected components as a comma separated list, status, and the incident id. When no windows match the filter there is nothing to record, so skip the append on those days too and let the workflow finish without writing anything.

Make the Statuspage page id, the Slack channel, the Google Sheets spreadsheet id and tab name, the local timezone, and the 24 hour lead time all easy to change at the top of the workflow, since teams often want a longer lead time for customer facing changes or a shorter one for a last call reminder.

Related prompts

Explore more prompts
Call overdue Xero customers with an AI collections agentLocal listing health board for every location you manageLet support send one-off Loops emails without an engineerA brand asset library your marketing team actually searchesTurn Mailjet email clicks into ranked HubSpot follow-upsClean out the Looker dashboards and Looks nobody opensStop cold emails to anyone with a live deal in PipedriveLiveKit live operations console for room moderationWake up dormant Keap leads with a researched reasoniMessage campaign console with pre-flight checks and delivery board