Weekly incident.io metrics to Google Sheets and Slack
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.
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.
Additional information
What does this prompt do?
- Pulls last week's incidents from incident.io and counts them by severity and type.
- Calculates mean time to resolution and the number of open follow-ups, with no manual spreadsheet work.
- Appends one fresh row to your Weekly incident metrics sheet so trends build up automatically over time.
- Posts a clean, pre-formatted snapshot to a Slack channel of your choice with this week's numbers and week-over-week deltas.
What do I need to use this?
- An incident.io account with permission to list incidents and follow-ups.
- A Google account connected to the Weekly incident metrics spreadsheet you want to write to.
- A Slack workspace, and the name of the channel where the leadership snapshot should land.
- The header row of your spreadsheet already set up so each metric has a column.
How can I customize it?
- Change the schedule. Move it off Monday 8am to whatever fits your leadership rhythm.
- Swap the destination Slack channel, or send to a private channel for senior engineering only.
- Adjust the metrics. Drop columns you don't care about, or add ones like incidents by team or by customer impact.
- Change the lookback window from seven days to fourteen or thirty for a longer trailing view.
Frequently asked questions
Do I need an AI model to run this?
How are the week-over-week deltas calculated?
What if I don't have a spreadsheet set up yet?
Can the Slack message go to a private channel?
What is mean time to resolution measured from?
Stop hand-rolling weekly incident reports.
Connect incident.io, Google Sheets, and Slack once, and Geni delivers the same trended snapshot to your leadership channel every Monday at 8am.