Weekly incident.io metrics to Google Sheets and Slack

By General Input

Every Monday at 8am, last week's incident.io activity becomes a trending row in your Sheet and a short Slack snapshot for engineering leadership.

Integrations

  • incident.io
  • Google Sheets
  • Slack

Type

Deterministic Code

Categories

  • Engineering
  • Operations

Build me a deterministic code workflow that runs every Monday at 8am and turns last week's incident.io activity into a metrics row in a shared Google Sheet plus a short Slack snapshot for engineering leadership. No reasoning or AI drafting. The column layout and message template are fixed.

Trigger: cron, every Monday at 8:00 in my workspace timezone.

Step 1. Use incident.io List Incidents to fetch every incident whose created_at falls in the trailing seven days (last Monday 00:00 through Sunday 23:59 in my workspace timezone). Page through results until you have them all.

Step 2. Use incident.io List Follow-ups to fetch all follow-ups for the organisation, then count the ones whose status is open (or any not-completed status) to get the open follow-ups number. This is a global open count, not just last week's.

Step 3. From the incidents list, compute a fixed set of numbers in code: total incident count for the week; a count per severity (one number per severity that exists in the response); a count per incident type (one number per type that exists in the response); mean time to resolution in hours, averaged across only the incidents that have both a reported timestamp and a resolved timestamp within the week, computed as resolved minus reported. Round MTTR to one decimal.

Step 4. Use Google Sheets Get Values on the Weekly incident metrics spreadsheet to read the last existing data row (the prior week's row). For each metric, compute the week-over-week delta as this week minus prior week. If there is no prior row, deltas are blank.

Step 5. Use Google Sheets Append Values to add one new row to the Weekly incident metrics sheet. Columns, in order: week_ending (Sunday's date, ISO yyyy-mm-dd), total_incidents, count_by_severity (one column per severity, matching the existing header), count_by_type (one column per type, matching the existing header), mttr_hours, open_followups. The spreadsheet ID and sheet/tab name should be configurable inputs at the top of the workflow.

Step 6. Use Slack Send a Message to post a short, pre-formatted snapshot to a configurable channel. Use Slack's mrkdwn formatting. Template:

*Weekly incident snapshot — week ending {date}* Total incidents: {n} ({+/-Δ} vs last week) By severity: {sev1}: {n} ({Δ}), {sev2}: {n} ({Δ}), ... By type: {type1}: {n} ({Δ}), ... MTTR: {h} h ({Δ} h) Open follow-ups: {n} ({Δ})

Deltas should render with a leading + or - sign; blank deltas (no prior row) render as a single dash.

Inputs that should be top-of-workflow configuration: spreadsheet ID, sheet/tab name, Slack channel ID or name, lookback window in days (default 7).

This is intentionally a code workflow rather than an agent. The numbers and message layout are fixed, so determinism and idempotency matter more than narrative quality. If the workflow runs twice on the same Monday, that is acceptable; the duplicate row can be deleted manually.

Related prompts

Explore more prompts
Call overdue Xero customers with an AI collections agentLocal listing health board for every location you manageWin back LiveChat visitors whose chats went unansweredLet support send one-off Loops emails without an engineerStop cold emails to anyone with a live deal in PipedriveiMessage campaign console with pre-flight checks and delivery boardChat quality review board for LiveChat support leadsLinkedIn Ads budget pacing dashboard for every client accountFront desk appointment confirmation board for the next 3 daysGive your team Looker numbers without buying more seats