What this automation does
Every new bill reaches the right person with enough context to decide in under a minute, and nothing gets paid without a recorded yes.
- Pick up the bill. The workflow starts when a bill is created in Xero, QuickBooks Online or BILL, or when the invoice processing workflow hands off a newly extracted bill.
- Look up the rule. It reads the approval matrix to find who approves for this department, GL account, vendor and amount band, and whether a second signature is required.
- Build the brief. An LLM writes three or four lines covering what the bill is for, how it compares with the vendor’s last several bills, and any flags such as a changed bank account, a price increase or a missing PO.
- Ask the approver. The brief, a link to the PDF and approve, reject and question buttons go to the approver as a direct message in Slack or Teams, or as an email with signed links.
- Escalate and delegate. If nobody answers within the deadline, the request moves to the delegate or the next approver up, and the AP lead sees every stuck bill in a morning digest.
- Record and release. The decision, approver ID, timestamp and a fingerprint of what was approved are written to an approvals log and reflected in the accounting system, so the bill becomes eligible for the next payment run.
When it is worth building
Build this when approvals live in email threads and your AP lead spends hours a week chasing people. The usual signals are late fees on bills that sat in someone’s inbox, early-payment discounts that expire before anyone approves, and an auditor asking who approved a payment while nobody can produce the answer.
Do not build it if you have one approver and a few dozen bills a month. A weekly review block on the calendar is enough. If you already pay everything through BILL and its approval policies match how you actually route, use them and skip the custom work. The custom version wins in three situations: routing depends on data off-the-shelf rules cannot reach (project codes, budget remaining, contract terms), approvers refuse to log into yet another tool, or you want an AI brief on every bill so approvers stop rubber-stamping.
Architecture
| Layer | What we use | Why |
|---|---|---|
| Trigger | Xero or QuickBooks Online webhooks, or polling BILL through its API using n8n’s HTTP Request node | Routing starts the moment a bill exists, with no one forwarding anything |
| Approval matrix | A Google Sheet for small teams, a Postgres table once the rules pass a few dozen rows | Finance edits thresholds and approvers without touching the workflow |
| Context brief | Claude Sonnet 5.5 or OpenAI’s GPT models through the API | Turns raw bill data and vendor history into a short, readable summary with flags |
| Approval surface | Slack interactive messages or Teams adaptive cards, with an email fallback | Approvers answer where they already work, which is what actually cuts cycle time |
| State and audit log | Postgres | One row per request with status, approver, timestamps and the approved fingerprint |
| Orchestration | n8n | Wait and timer steps for escalation, plus built-in Xero, QuickBooks Online, Slack and Teams nodes |
How to build it
- Write the real matrix down. Interview whoever approves bills today. Most companies discover their actual rules differ from the written policy. Capture amount bands, department or class, GL ranges, vendor exceptions and which bills need two approvers.
- Encode segregation of duties. The person who created the vendor or entered the bill cannot approve it. Make that a check in the router, not a convention people are expected to remember.
- Normalize the trigger. Whatever the source, convert each bill into one internal shape with vendor ID, amount, currency, due date, lines with GL and class, and an attachment URL.
- Generate the brief. Pass the bill and the vendor’s last six to twelve bills to the model, and ask for a short summary plus flags from a fixed list. Compute price changes and averages in code and hand the model the results. Never ask it to do the arithmetic.
- Send and wait. Post the interactive message, then pause the workflow until a button is clicked or the timer fires. On every click, verify the user against the assigned approver.
- Handle reject and question. Reject returns the bill to AP with the reason. Question opens a thread with the requester and restarts the clock once they answer.
- Write back and fingerprint. On approval, store a hash of vendor, amount and coding. In Xero, move the bill from Submitted to Authorised. In most QuickBooks Online setups, the approval record lives in the log and the payment run is built only from approved bill IDs.
- Run in shadow mode for two weeks. Route in parallel with the old process and compare who the matrix picked against who actually approved. Fix the matrix, not the code, when they disagree.
The downloadable starter template below gives you the trigger, matrix lookup, Slack approval message and escalation timer to adapt to your own rules.
What breaks in production
- Stale approvers. Someone leaves or changes roles and bills route to a deactivated account. Check approver IDs against your Slack or Teams directory nightly and alert on any miss.
- Threshold splitting. A $12,000 purchase shows up as three bills under a $5,000 limit. Sum open bills per vendor over a rolling window and route the group to the higher approver when it crosses the line.
- Rubber stamping. Approvers clicking yes on a phone in two seconds. Track time-to-decision. Consistently instant approvals on large bills mean the brief needs sharper flags or the bill needs a second approver.
- Edits after approval. Coding or amounts get corrected after the yes. The fingerprint check catches this, but only if it runs right before payment and not just at approval time.
- Clicks from the wrong person. A message in a shared channel can be clicked by anyone in it. Send approvals as direct messages and verify identity on every action.
- Reminder fatigue. Deadlines that are too short train people to ignore the bot. Start at two business days and tighten only after you have data.
Timeline and cost
A single-entity setup with one approval surface usually takes two to three weeks, including the shadow period. Lumeor builds it for $4,000 to $10,000, depending on how complex the matrix is, whether you need both Slack and Teams, and how many entities or currencies are involved. Running costs are small: one short model call per bill plus n8n hosting. The workflow automation cost breakdown explains what moves the price. If you also want purchase requests, contract sign-offs or spend requests routed the same way, the internal approvals guide covers that broader pattern.
How to measure success
- Median hours from bill creation to approval, before and after launch
- Share of approvals completed inside the deadline without escalation
- Late fees paid and early-payment discounts captured each quarter
- Bills paid without a recorded approval, which should be zero
- Approvals voided by the fingerprint check, which shows where post-approval edits happen
- Median seconds approvers spend before deciding on bills above your highest threshold