Reads supplier invoices, checks the maths, VAT, duplicates and bank details, and sends clean ones to accounting without a human.
n8nOpenAI visionPostgreSQLS3Xero
Business problem
Finance teams re-type invoices into accounting by hand, miss duplicates, and pay the occasional fraudulent invoice with changed bank details.
Solution
Invoices arrive by email or upload. OpenAI vision extracts every field; SQL rules check line maths, VAT rates, dates, duplicates, purchase orders and limits. Clean invoices are approved automatically; anything else gets a review page, and a bank-detail change blocks payment until confirmed.
What it saves
≈ 36 hours and $1,000+ saved per month
for a business processing 400 supplier invoices a month
Manual handling: ~6 min per invoice to open, check and type into accounting → 40 h/month.
With LedgerFlow ~70% go through untouched; the rest take ~2 min on the review page → about 4 h/month.
36 hours saved × $30/h ≈ $1,080 per month. One blocked payment to a fraudster’s bank account can be worth more than the whole project.
Illustrative estimate based on the assumptions above. Every business is different: the numbers are worked out for your process before anything is built.
Ways to adapt it to your business
Intake: a dedicated invoices@ inbox, uploads, Google Drive / Dropbox folders, or supplier portals.
Accounting: Xero, QuickBooks Online, FreeAgent, Sage — draft bills with the original attached.
Your own rules: approval limits, purchase-order matching, VAT rates, cost centres, multiple currencies.
Approvals and alerts in Slack or Microsoft Teams; receipts and expense claims too.
the validation rules, suppliers, documents and audit trail
S3 / MinIO
stores every original file
Xero
draft bills with the original attached
Slack
alerts, decisions, weekly summary
Live demo
Run an invoice through the pipeline
Act as the bookkeeper of a fictional agency. Send a supplier invoice through the pipeline: the AI reads it, the rules check it, and you see the decision.
Runs live here
AI reading of PDFs and phone photos
All checks: maths, VAT, duplicates, bank details, PO, limits
A SHA-256 fingerprint of every file: the same invoice sent twice is recognised and never processed again.
From Upload? · Respond Accepted
Uploads get an immediate answer with the document id; processing continues in the background.
New Document? · Loop Over Documents
Processes new documents one by one, so one bad file never stops the others.
Build Extraction Request · Store Original
Stores the original in S3 and prepares the file for the vision model.
AI Extract · Parse Extraction
OpenAI reads supplier, VAT number, bank details, dates, line items and totals into a strict JSON schema with confidence scores.
Save & Validate
One PostgreSQL function applies every rule: line maths, VAT rates, dates, duplicates, purchase orders, limits and changed bank details — and decides auto-approve or review.
The team sees who approved or rejected what, and whether bank details were confirmed.
Technical implementation
Originals stored in S3 (MinIO) and fingerprinted so a file is never processed twice. Validation is a tested PostgreSQL function; approving a new supplier once teaches the system. Approved bills are exported to Xero as drafts with the original attached; Slack alerts and weekly reports.
Business value
Most invoices go through untouched, people only look at real exceptions, and fraud attempts are stopped before payment.
What this changes for the business
Most invoices go from inbox to accounting without anyone typing a number.
People only look at real exceptions, with the problem already explained and the original next to the data.
Duplicates and changed bank details are stopped before payment, protecting the business from the most common invoice fraud.
Month-end close gets faster: every bill is already coded, checked and attached to its original.