FINANCE

Severe cohort-margin erosion PagerDuty escalation

Runs a BigQuery margin check and, only when a high-value cohort erodes past a severe threshold, triggers a PagerDuty incident and logs the event to a Postgres audit table.

CategoryFinance
Enginesim
Difficultyadvanced
Triggerschedule
Steps5
Setup~25 min

How it runs

The automated pipeline, trigger to output.

  • TriggerQuarterly schedule after quarter close
  • ActionQuery BigQuery cohort margin and revenueGoogle BigQueryBigQuery
  • LogicGate on severe erosion AND material revenue
  • ActionTrigger PagerDuty incident per qualifying cohortPagerDutyPagerDuty
  • OutputWrite escalation to Postgres audit tablePostgreSQLPostgres

What it does

This is the escalation tier for cohort-margin erosion. It checks BigQuery for cohorts crossing a severe decline threshold, but escalates only when the eroding cohort also carries material revenue, avoiding noise. When both conditions hold, it opens a PagerDuty incident and records the event to a Postgres audit table.

When to use it

Use it when certain cohorts are large enough that a quiet margin collapse warrants paging the finance on-call, not a Slack message that waits until Monday. The revenue gate ensures only consequential erosions trigger a page.

How it works

  1. 1A scheduled trigger runs after quarter close.
  2. 2A BigQuery query returns per-cohort gross margin and the cohort's trailing revenue.
  3. 3A logic step applies a two-condition gate: severe erosion AND revenue above the materiality floor.
  4. 4For each cohort passing the gate, a PagerDuty incident is triggered with the cohort detail and severity.
  5. 5An output step writes the escalation to a Postgres audit table for compliance and post-incident review.

Set it up

What you configure once, before turning it on.

  1. 1
    Connect BigQueryDatasets, queries, schemas.
  2. 2
    Connect PagerDutyIncidents, on-call, escalations.
  3. 3
    Connect PostgresAny Postgres URL — query, write, migrate.
  4. 4
    Set each agent's modelWe leave models unset so you pick the tier — fast + cheap, or top-quality.
  5. 5
    Tune it to your dataEdit the prompts, filters, and field mappings so it matches how your team works.
  6. 6
    Test, then turn it onRun once against a sample, confirm the output, then enable the trigger.

Run this workflow in your colony.

14-day trial. No DevOps. No Sales call. Provisioned in under a minute.