AI and automation

7 min read

How an AI pipeline reads 1,500 bill lines a month for an exporter

Supplier bills arrive as PDFs, scans and Excel sheets. The pipeline reads each one, matches the supplier by GST number and leaves a draft in Zoho Books for approval.

S&J Sales Corporation's accounts team recorded every supplier bill in Zoho Books by hand. Open the bill, find the supplier, re-type every line: item, quantity, rate, tax, total. Every bill was read twice, once on paper and once on screen.

The bills came in three shapes: PDFs from suppliers' billing systems, scanned or photographed paper bills, and Excel sheets. Each line's GST had to be split into CGST and SGST, or charged as IGST, depending on where the supplier was registered.

We built a pipeline in n8n that now reads about 1,500 bill line items a month without anyone re-typing them. This is how it works.

1. Capture

Bills are dropped into a shared Google Drive folder and picked up within about a minute. Each file is fingerprinted when it arrives. A bill sent twice, or dropped in by two people, is processed once. Duplicates are stopped at the door, not found at month-end.

2. Read, by format

The pipeline checks the file type and sends it to the reader built for it: one for PDFs, one for scans and phone photos, one for Excel. Google Gemini does the reading. All three readers return the same structured record (supplier, GST number, dates, lines, taxes, totals), so every later step works the same way.

3. Match the supplier by GST number

Supplier names are spelt differently on almost every bill. The GST number isn't. The pipeline looks the supplier up in Zoho Books by GST number first and falls back to name and known aliases only when it has to. One supplier stays one supplier.

4. Map items and set GST

Each line is mapped to an item in S&J's Zoho Books catalogue, and the pipeline remembers how lines were mapped before, so a familiar line lands the same way next time. GST is set from the state codes in the two GST numbers: CGST and SGST within a state, IGST across states.

5. Draft, never post

Every bill is saved in Zoho Books as a draft with the supplier's original file attached. The accounts team opens the draft, checks it against the bill beside it and approves it. A bill that can't be matched, or whose lines don't add up to its total, is held back and the team gets a Slack or email alert with the reason. Every step is written to an audit log in Google Sheets.

The rule we built it on

AI reads. Rules decide. Gemini reads the document and nothing more. Matching, item mapping and tax follow fixed rules against S&J's own records. Every draft can be explained line by line, and the same bill always produces the same entry.

That split is the part to copy. Use a model where the input is messy (a photographed bill) and fixed rules where the output has to be right (the ledger). Keep a person on the approve button.

What changed

  • About 1,500 bill line items a month read and drafted, none re-typed

  • Three bill formats handled: PDF, scan and Excel

  • Zero duplicate bills reaching the books

The accounts team's job moved from typing bills to checking them. As the supplier base grows, the pipeline takes the extra bills without adding hours to anyone's week.

Read the full S&J case study or book a 30-minute audit to map your own bill flow.

Read next

Book a 30-minute audit

Two days to scope it.

No charge if we decline the work. 20+ businesses on our systems.