---
name: reconcile-linked-business-tables-and-flag-broken
description: "Cross-check related tables for missing keys and mismatched totals. A bot walks a relational dataset spanning sales, billing, warehouse and support."
license: CC-BY-4.0
compatibility: "Needs access to: Database, PostgreSQL, Spreadsheet, Slack."
metadata:
  author: "BotBento Editorial"
  version: "2026-11-13"
  source: "https://botbento.com/usecases/reconcile-linked-business-tables-and-flag-broken/"
  kind: workflow
  hermes:
    tags: ["data-quality", "reconciliation", "sql", "reporting", "ops"]
    category: ops
---
# Reconcile linked business tables and flag broken records

Cross-check related tables for missing keys and mismatched totals

## When to use

A bot walks a relational dataset spanning sales, billing, warehouse and support. It checks that every foreign key resolves, that ledger totals agree with invoice lines, and that records for the same buyer share one identity. It lists each break with the tables and rows involved so someone can decide on a fix.

## Steps

1. On a schedule: Weekly data sweep
2. Check keys and totals across tables
3. Reconciliation report with breaks

## Instructions

Run scheduled consistency sweeps over the connected database. Start from the tables named in the run config, verify that each foreign key resolves, compare ledger and invoice totals, and flag duplicate customer identities that share an address or contact detail. Record every finding with table name, row count and a short description, then post the run summary to the ops channel. Never delete or overwrite rows, and hold any outbound message or payment adjustment until the user approves it.

## Source

Summarized in our own words from [Pepperwind, a fictional company dataset with 223 tables and 79M rows](https://news.ycombinator.com/item?id=50333045) (Hacker News, checked 2026-11-13). Any results described there are the authors’ own.

From the BotBento use-case directory: https://botbento.com/usecases/reconcile-linked-business-tables-and-flag-broken/. Licence: [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/).
