Triage failed data quality checks before stakeholders see bad numbers

Last updated

DifficultyMedium
SetupSome code
Best forData engineer
Toolsdbt tests, Great Expectations, Soda, Monte Carlo, Claude Code, n8n + an LLM, Slack

Copy this prompt

Paste this into a general agent such as ChatGPT agent or Claude, then add your own inputs.

Help me run this UseCaseProof playbook: Triage failed data quality checks before stakeholders see bad numbers.

The problem: Data teams run tests on their pipelines: freshness checks, row counts, not-null and uniqueness rules, accepted values and schema checks. When several fail overnight, someone has to work out which failure matters, whether the cause is a late source, an upstream schema change, a bad deploy or a real change in the business, and who owns it, usually before a dashboard everyone uses is wrong. Alert channels fill with noise and real problems get noticed by an executive first.

How the agent should work: After each scheduled run, the agent reads the test results and run logs from your transformation tool or data quality platform. For each failure it groups related alerts by shared upstream source using lineage, samples a few failing rows with read-only queries, compares row counts and distributions with recent runs, and checks recent commits and source schema changes. It then classifies the failure (late or missing data, schema change, bad logic in a model change, a few bad records, or a broad shift in the data), lists the dashboards and models downstream, names the likely owner from your ownership metadata, and posts one triage note per incident with evidence. When the cause is clear and in code, it can open a pull request with a proposed fix and a test, but it does not merge, rerun production jobs or change data. A person decides whether to pause a dashboard, warn stakeholders or roll back.

Follow these steps:
1. List your tests and checks, mark which ones protect important dashboards or customer-facing data, and add owner metadata to models and sources
2. Give the agent read-only warehouse credentials scoped to the relevant schemas, plus access to test results, run logs, lineage and the repository
3. Write triage rules: how to group failures, the classification categories, and which downstream assets count as high impact
4. Have it post one note per incident to your data alerts channel or ticket queue, with failing row samples, recent changes and impacted assets
5. Allow it to open draft pull requests for code fixes with a new or updated test, never to merge or deploy
6. Agree who warns stakeholders and who can pause or annotate a dashboard, and keep that with people
7. Review each week which alerts were noise and adjust test thresholds or retire tests that nobody acts on

Human-approval checkpoint: Data engineers review every triage note, decide on reruns, backfills and rollbacks, and review and merge any proposed fix. The data owner or analytics lead decides when to warn stakeholders or mark a dashboard as stale. The agent never edits production data or deletes failing rows.

Guardrails: Failing rows can contain personal or sensitive data, so mask sample values in notes and keep samples out of public channels. A confident root cause can be wrong, especially for a real business change that looks like a data error, so the note should show evidence and a confidence level. Read-only access matters: an agent with write access could 'fix' a test by changing data. Query costs can add up on large tables, so cap sampling queries and run them on limited partitions.

Suggested tools from this playbook (not ranked; check current features and pricing): dbt tests, Great Expectations, Soda, Monte Carlo, Claude Code, n8n + an LLM, Slack.

Do not send messages, move money, grant access, merge code, or take any irreversible action until I approve. If you need an input I have not provided, ask me instead of guessing.

The problem

Data teams run tests on their pipelines: freshness checks, row counts, not-null and uniqueness rules, accepted values and schema checks. When several fail overnight, someone has to work out which failure matters, whether the cause is a late source, an upstream schema change, a bad deploy or a real change in the business, and who owns it, usually before a dashboard everyone uses is wrong. Alert channels fill with noise and real problems get noticed by an executive first.

How the agent works

After each scheduled run, the agent reads the test results and run logs from your transformation tool or data quality platform. For each failure it groups related alerts by shared upstream source using lineage, samples a few failing rows with read-only queries, compares row counts and distributions with recent runs, and checks recent commits and source schema changes. It then classifies the failure (late or missing data, schema change, bad logic in a model change, a few bad records, or a broad shift in the data), lists the dashboards and models downstream, names the likely owner from your ownership metadata, and posts one triage note per incident with evidence. When the cause is clear and in code, it can open a pull request with a proposed fix and a test, but it does not merge, rerun production jobs or change data. A person decides whether to pause a dashboard, warn stakeholders or roll back.

Setup steps

  1. List your tests and checks, mark which ones protect important dashboards or customer-facing data, and add owner metadata to models and sources
  2. Give the agent read-only warehouse credentials scoped to the relevant schemas, plus access to test results, run logs, lineage and the repository
  3. Write triage rules: how to group failures, the classification categories, and which downstream assets count as high impact
  4. Have it post one note per incident to your data alerts channel or ticket queue, with failing row samples, recent changes and impacted assets
  5. Allow it to open draft pull requests for code fixes with a new or updated test, never to merge or deploy
  6. Agree who warns stakeholders and who can pause or annotate a dashboard, and keep that with people
  7. Review each week which alerts were noise and adjust test thresholds or retire tests that nobody acts on

Tools that can do this

  • dbt tests
  • Great Expectations
  • Soda
  • Monte Carlo
  • Claude Code
  • n8n + an LLM
  • Slack

Some tool links may be affiliate links. We only list tools that fit the playbook; recommendations are not sold. Disclosure.

Not ranked. Tools marked Featured pay for a highlighted listing; that never decides which tools we include. Check each vendor's current features and pricing.

Make one of these tools? Feature your tool on every playbook where it is already listed.

Human in the loop

Data engineers review every triage note, decide on reruns, backfills and rollbacks, and review and merge any proposed fix. The data owner or analytics lead decides when to warn stakeholders or mark a dashboard as stale. The agent never edits production data or deletes failing rows.

Risks and guardrails

Failing rows can contain personal or sensitive data, so mask sample values in notes and keep samples out of public channels. A confident root cause can be wrong, especially for a real business change that looks like a data error, so the note should show evidence and a confidence level. Read-only access matters: an agent with write access could 'fix' a test by changing data. Query costs can add up on large tables, so cap sampling queries and run them on limited partitions.

ROI notes

Track time from a failed check to a triaged incident, the number of incidents first reported by stakeholders rather than tests, and the share of alerts closed as noise. The value is catching and explaining problems before people act on bad numbers; it depends on having meaningful tests in the first place.

Quick answers

How do I triage failed data quality checks before stakeholders see bad numbers?

After each scheduled run, the agent reads the test results and run logs from your transformation tool or data quality platform. The full setup is 7 steps.

Do I need to code to set this up?

Some code is needed. We rate the setup Medium.

Which tools can do this?

dbt tests, Great Expectations, Soda, Monte Carlo, Claude Code, n8n + an LLM, Slack. Not ranked; check each vendor's current features and pricing.

Where does a human stay in control?

Data engineers review every triage note, decide on reruns, backfills and rollbacks, and review and merge any proposed fix. The data owner or analytics lead decides when to warn stakeholders or mark a dashboard as stale.

What's a starter prompt I can paste into ChatGPT agent or Claude?

A playbook-specific starter prompt is in the Copy this prompt section above. It is written from this playbook's steps and human-approval checkpoint, for a general agent such as ChatGPT agent or Claude.

Also useful: investigate production errors and failed overnight jobs; triage failed CI runs; analyze a spreadsheet by asking questions; explain month-end variances (after the data is right).

All AI agent examples, by function · More Software Engineering playbooks