Automation project
Invoice reader with n8n
An n8n workflow for supplier invoices: you upload the PDF to a form, an AI model extracts supplier, tax ID, number, date, amounts and currency, the workflow checks everything adds up and that it isn't a duplicate, logs it in Google Sheets and, if something's wrong, alerts me by Gmail. Here you can try the same logic in your browser.
In the demo, PDFs are read in your browser and never sent anywhere. The sample invoices are from fictitious companies.
The n8n workflow
Trigger
- Upload Invoiceweb form to upload the PDF
Extract invoice data
- Extract PDF Textextracts the PDF text
- Extract Invoice Fieldsan OpenAI model reads the 8 fields
Validate and record
- Validate Datarequired fields and net + VAT = total
- Find Existing Invoiceslooks up the number in Google Sheets
- Compute StatusOK, REVIEW or DUPLICATE and the reason
- Append Invoice Rowadds the row to the Invoices sheet
Alert on problems
- Needs Alert?is the status not OK?
- Send Alert EmailGmail alert with the details
These are the real nodes of the exported n8n workflow. While an invoice is processed, the node it's on lights up. In n8n an OpenAI model reads the fields; in the demo I do it with rules in the browser so your invoices never leave your device.
Try the workflow
Alerts sent by Gmail
Every invoice that isn't OK triggers an email like these, in the same format the workflow sends.
How it works
Input and extraction
The invoice comes in through an n8n form. The PDF text goes to an Information Extractor with an OpenAI model, which returns 8 fields: supplier, issuer tax ID (not the customer's), number, date, net, VAT, total and currency. If a field is missing it leaves it blank rather than guessing.
Validation
A code node checks that no field is missing and that net + VAT = total, with a 2-cent tolerance for rounding.
Duplicates
It looks up invoices with the same number in Google Sheets and flags a duplicate if the tax ID or supplier name also match, so the same invoice is never paid twice.
Log and alerts
Each invoice is appended to the sheet with its status, reason and processing time. If the status isn't OK, the workflow emails all the details for review.
Educational demo reproducing the logic of my n8n workflow; sample invoices use fictitious data.