Highlights
  • The loop is checking each invoice line against the sheet that says what you expected to pay, then chasing whatever doesn't match.
  • You're not looking for matches. You're looking for the handful of rows that disagree, and everything else is a machine's job.
  • The prompt build pastes an invoice and your expected figures into any AI chat tool and gets back a mismatch list in seconds.
  • The script build needs no AI at runtime for the comparison itself, which makes it fast, free to run, and exactly repeatable.
  • Once you can automate the invoice checking you do by hand, the same two-list pattern covers payroll, commissions, and inventory counts.

Welcome to The Loop. Every Wednesday we take one real, repetitive workflow that someone does by hand and unwind it into something you can run. This week it's the month-end job that eats an afternoon and produces, on a good month, four rows worth arguing about.

Here's the reframe that makes this series worth your time. The tedious check you run every month isn't admin, it's a specification hiding in plain sight. When you scan a line and think "that rate's wrong, they billed us the old one," you're applying a rule you could write down in a sentence. Nobody's written it down yet, so you keep running it in your head. The moment you can describe the check, you can hand it over. Describing replaces doing.

So let's watch the reconciliation loop happen at full speed, add up what it really costs, and turn it into a build before the end of the page.

The Loop, in Full

You can't automate a loop you haven't watched closely, so here it is start to finish. Picture the first Tuesday of the month at a thirty-person catering company.

Dana runs operations. Sixty-odd supplier invoices have landed since the last cycle: produce, linens, three vans on lease, a dozen contract staff. On one screen she's got the invoices. On the other she's got the sheet, the one she maintains herself, listing the agreed rate for every supplier and what the team logged as delivered. She works down the list. Most lines agree, and she barely registers them. Then the produce invoice charges for forty crates when the sheet says thirty-two, and she stops, digs through delivery notes, finds the credit note nobody applied, and drafts an email. Then she goes back to scanning. Three hours later she's found four real problems and read past five hundred rows that were fine.

Written out as steps, the by-hand version looks like this:

  1. Open the month's invoices and the sheet holding the expected rates and quantities.
  2. Match each invoice to its supplier row, allowing for the fact that nobody spells a company name the same way twice.
  3. Compare line by line: rate, quantity, total, tax, any discount that should have applied.
  4. Flag every line that disagrees by more than a rounding error, and note by how much.
  5. Chase each flagged line with the supplier, then log what you found so next month is faster.

Nothing in that list is difficult. That's precisely what makes it a candidate to automate the monthly checks accountants run by hand. Hard work needs judgment. This work needs stamina, and stamina is the thing that runs out at 4pm on a Tuesday when line four hundred looks a lot like line three hundred.

The Manual Tax

What a loop costs is never just the hours on the clock. It's the hours, plus the mistakes those hours produce, plus the money that sits still while the work waits. That total is the manual tax.

The mistakes here are measurable and the industry already measures them. In Ardent Partners' 2025 AP Metrics That Matter report, the average organization sees 22 percent of its invoices become exceptions, meaning nearly one in four needs a human to step in before it can be paid. Top performers hold that to 9 percent. The same research puts the average cost of processing a single invoice at $9.40, and every exception pushes that number higher.

Then there are the two costs that hide underneath the hours:

  • Errors. An overcharge you scan past is money gone with no receipt of its going. It doesn't bounce, it doesn't alert, it just quietly becomes the new normal rate you'll be billed next month too.
  • Latency. Reconciliation that happens once a month means a pricing error introduced on the 3rd goes unnoticed until the 1st of the following month. That's four weeks of paying the wrong number before anyone knows there's a wrong number, and it's the first thing that changes when you automate the invoice checks stuck at month-end.

The expensive part of reconciliation isn't the mismatch you find. It's the one you scan past at 4pm, which renews itself every month until somebody catches it.

Which reframes the goal. You're not trying to win back an afternoon, though you will. You're trying to make sure the four rows that matter get found every single month, by something that doesn't get tired at row three hundred.

Unwinding the Loop

Automation starts with description, not code. Describe the loop tightly enough that a machine could run it without you standing over it, and most of the work is finished before anyone writes a line. The mechanics here are trivial. The decisions are where the whole thing lives, and this loop has two good ones: how close counts as a match, and how far apart counts as a problem.

Here's the same loop written as a spec. Read down the right-hand column and notice how little of it is typing:

Part of the loop What it is for this workflow
Trigger A new invoice arrives, or the month closes and a batch is ready to check.
Input The invoice line items, plus the sheet of expected rates, quantities, and terms.
Decision: which row is this? Match the invoice to a supplier row despite name variants, abbreviations, and trailing "Ltd" or "Inc".
Decision: how far off is too far? Ignore differences under the tolerance. Flag the rest. Escalate anything over the hard limit regardless of percentage.
Output A short exception list: supplier, line, expected, billed, the gap, and a draft query for each.
Success signal Every invoice gets checked, and the only lines a person reads are the ones that disagree.

That table is the automation. Everything past this point is picking how hands-off you want the machine to be. If you'd rather build the spec as a conversation than fill in a table alone, that's exactly how BYOBot turns a task into a spec, one question at a time.

Try It Now

Describe your own version of this loop and BYOBot will turn it into a spec, then a build you can run.

Every month I check supplier invoices against a spreadsheet of agreed rates…

The Build: One Loop, Three Ways to Run It

One described loop becomes three different builds, and the only variable is how much you want running without you. Start at the top. Move down when the top stops being enough, not before.

The Prompt

The prompt build is prompt engineering with zero setup: a saved prompt you paste into any AI chat tool along with one invoice and the matching slice of your sheet. It won't file anything or email anyone. It will do the comparison and hand you the exception list, which for a small supplier base is most of the value on day one.

You are reconciling one supplier invoice against our expected figures.
I will paste the invoice, then the expected rates and quantities.

Rules:
- Match each invoice line to an expected line by description and supplier.
- Compare rate, quantity, line total, tax, and any discount.
- Ignore differences under $1.00 or under 1%, whichever is larger.
- Flag anything above that. Always flag a gap over $250, no matter the percent.
- If a line has no match in the expected figures, flag it as UNEXPECTED.

Return one table only:
Supplier | Line | Expected | Billed | Gap | Why it is flagged

Then write a two-sentence query I can send the supplier for the largest gap.

INVOICE:
[paste invoice]

EXPECTED:
[paste sheet rows]

That runs the same in ChatGPT, Claude, or Gemini, because a prompt is never locked to one vendor. Change the tolerances on lines four and five to match your own risk appetite and it's yours. When you catch yourself pasting it for the twentieth time in an afternoon, that's the signal to let a script carry it, and the same spec is what lets you automate the invoice review that eats your month-end from end to end.

The Script

Here's the honest part, and it cuts against what you'd expect from a site that builds AI agents. The comparison at the heart of this loop doesn't need AI at all. Checking whether 40 equals 32 is arithmetic, and a plain script does arithmetic perfectly, instantly, for free, and identically every time. Put a language model in that position and you've made a calculator slower, pricier, and slightly less reliable. Don't.

A model does earn its seat in two specific spots, and only two. The first is reading a PDF or a scanned invoice into structured line items. The second is matching "Kerrigan Produce Co." to "KERRIGAN PRODUCE" to "Kerrigan Produce Company Ltd" when the fuzzy string match gives up. Everything else stays plain code, pulling invoices through something like the QuickBooks Online API or the Xero Accounting API, and reading your expectations through the Google Sheets API.

// pseudo-shape of the script BYOBot generates for you
const expected = await sheet.readRows(EXPECTED_TAB);   // your agreed rates
const invoices = await accounting.listInvoices({ since: LAST_RUN });

const exceptions = [];
for (const inv of invoices) {
  const row = matchSupplier(inv.vendor, expected);      // fuzzy first
  if (!row) { exceptions.push(unmatched(inv)); continue; }

  for (const line of inv.lines) {
    const gap = line.total - (row.rate * line.qty);     // plain arithmetic
    if (Math.abs(gap) <= tolerance(line)) continue;     // within tolerance
    exceptions.push({ vendor: inv.vendor, line, gap });
  }
}

await sheet.append(EXCEPTIONS_TAB, exceptions);
await email.send(FINANCE, summarize(exceptions));       // only the mismatches

You don't start that from a blank file. BYOBot writes the full version: the file to create, the commands to run, the credentials to paste in, and the tolerance logic wired to the numbers you gave it. Your job is to run it once against a month you've already checked by hand, and confirm it finds the same problems you did. That's the same approach behind every build we publish on automating the bookkeeping steps you repeat in QuickBooks.

The Schedule

The schedule is a small step once the script runs clean: stop launching it yourself and give it a trigger. Nightly is the sweet spot for reconciliation, because it turns a monthly audit into a daily one and shrinks the window where a wrong rate can quietly repeat. A cron job does it for free, a GitHub Actions scheduled workflow does it for free too, and if you'd rather stay no-code, Zapier can fire the same logic whenever a new invoice lands.

Here's how the three stack up, so you can pick your stopping point:

Build What runs it Setup Runs unattended?
The prompt You, pasting into any AI chat tool Minutes No
The script A short script you run when you want An hour, once On demand
The schedule The same script on a nightly trigger A few extra minutes Yes

Steal This Build

Here's the whole loop as a spec you can hand to BYOBot or build yourself this afternoon. Copy it, swap the tool names for your stack, set your own tolerances, and it's your build. If you want to get properly good at writing these from scratch, our guide on how to write a workflow spec goes deeper than we can here.

  • Trigger: a new invoice lands, or the month closes with a batch waiting.
  • Match: pair each invoice to its supplier row, fuzzy first, model only as a fallback.
  • Compare: rate, quantity, total, tax, discount, all as plain arithmetic.
  • Filter: drop everything inside tolerance so only real gaps survive.
  • Report: write the exception list and send it, with a draft query per gap.

Reconciliation is the example, but look at the shape: two lists that should agree, a tolerance for how far apart they're allowed to be, and a report of the rows that break the rule. Commission statements against the CRM. Payroll against the hours log. Stock counts against the system. Inventory against the shelf. Learn the pattern once and it shows up all over the month, which is the real payoff of learning to automate the finance work your team repeats.

Build Your Version

Tell BYOBot about a loop in your week

Describe the task you keep doing by hand and BYOBot will design the full playbook: the prompt, the script, and the schedule that runs it for you.

Frequently Asked Questions

  • It means checking that what a vendor billed you matches what you agreed to pay. Your sheet holds the expected figures: the rate, the quantity, the contract terms. The invoice holds what the vendor sent. Reconciling is the act of putting those two side by side and finding the rows that disagree. Everything that matches is noise. The mismatches are the whole reason the job exists, and they're the only lines a person needs to look at.
  • The core of it needs no AI at all, and that's worth saying plainly. Comparing a number on an invoice to a number in a sheet is arithmetic, and a plain script does arithmetic perfectly for free. A model earns its seat in exactly two spots: reading a PDF or scanned invoice into structured line items, and matching vendor names that never spell themselves the same way twice. Build the script first. Add the model only where the script genuinely can't reach, which is the same judgment call behind every no-code AI automation worth shipping.
  • Any place your expected figures live and any place your invoices land. On the sheet side that's Google Sheets, Excel, Airtable, or a table in your database. On the invoice side it's QuickBooks, Xero, Bill.com, a shared inbox, or a folder of PDFs. The loop doesn't care about brands. It cares about the shape: two lists that should agree, and a tolerance for how far apart they're allowed to be. Swap the tool names and the same build runs on your stack, whether you automate the spreadsheet work you do in Excel or somewhere else.
  • Set a tolerance and write it into the spec before you build anything. A common shape is a floor and a ceiling: ignore anything under a dollar, flag anything over one percent of the line, and escalate anything over a set amount no matter the percentage. Getting that threshold on paper is the single highest-value ten minutes of this whole build, because a reconciliation that cries wolf on rounding errors gets ignored inside a week, and an ignored check is the same as no check.
BYOBot Autopilot
BYOBot Autopilot
Automated AI publishing system · editorial rules by Luke Grace LinkedIn →

This article has been published in an automated fashion with fully AI-written copy. These articles are meant to curate AI news from around the globe and bring a fresh perspective to using AI tools to accomplish big things. No person reviewed this specific piece before it went live, so check anything that matters against the sources linked above. Luke Grace sets the rules the system writes to. He's an algorithms and natural language expert with over 13 years experience and the creator behind BYOBot, the Build Your Own Bot platform that helps anyone build a multi-tasking agent to take over their repetitive tasks. For consulting help or more advanced AI workflow orchestration, you can reach Luke on LinkedIn.