Structured or unstructured: what documents do you have
Extracting data from a PDF means turning a document's content (numbers, dates, amounts, names) into structured fields that a spreadsheet or accounting system can use without anyone retyping them. The right tool depends on how predictable the document is, so start by sorting what you receive into three groups.
- Documents that already exist in structured form. Electronic invoices are the main case. In Italy, where we work, invoices between businesses go through the SDI exchange system as FatturaPA XML, with a schema published by the tax authority, and more EU countries are moving the same way. The PDF a supplier attaches is only a readable copy. For these, OCR is the wrong approach: read the XML and you get the exact data.
- Fixed-layout documents. Delivery notes from the same carrier, statements from the same bank, orders from a customer portal: values change, field positions don't.
- Mixed documents. Invoices from foreign suppliers, expense receipts, quotes, order confirmations in ever-changing formats.
Where e-invoicing is mandatory, the first group is often the majority. Moving it to XML solves much of the problem before AI even comes up.
Template parsers, OCR and AI compared
Template parsers
You define once where each field sits, with coordinates or text rules ("the number after the word Total"). This works well and cheaply on fixed layouts with selectable text. It breaks as soon as the supplier changes the layout, and you need one template per format.
Specialised OCR for invoices and receipts
Services such as Azure AI Document Intelligence (the prebuilt-invoice model), Google Document AI (Invoice Parser and Expense Parser) and Amazon Textract (AnalyzeExpense) read text, including from scans and photos, and return standard fields: invoice number and date, supplier, total, tax, line items. Textract, for example, maps different labels such as "invoice number" or "bill number" to the same field and returns a confidence score for every value. They are the most reliable choice for invoices and receipts in varied formats.
Generative AI models
A language model receives the document's text or image and returns JSON with the requested fields. It's the most flexible option: it reads quotes, contracts, documents it has never seen. It's also the least predictable, because it can invent a plausible value when a field is missing. Use it with a strict output schema and the validations described below. The principle is the same as request classification, covered in our article on AI in Make and n8n: narrow output, checks afterwards.
For an office handling a few hundred mixed documents a month, we would start with a specialised invoice and receipt service and add an AI model only for documents that service doesn't cover.
A typical workflow: email, extraction, sheet or accounting system
A workflow that works in Make or n8n usually follows these steps.
- Intake: a dedicated inbox, for example invoices@, or a shared folder. Incoming emails should be sorted first, as described in our guide to sorting incoming emails.
- Attachment filter: only PDFs and images, skipping logos and signatures. If an e-invoice XML is attached, use that.
- Extraction: call the chosen service, which returns fields as JSON.
- Normalisation: ISO dates, amounts as numbers with a decimal point, VAT numbers without prefixes or spaces.
- Validation: the checks in the next section.
- Write: a row in Google Sheets or a draft entry in the accounting system, with a link to the original file.
Always save the service's raw response next to the normalised fields: when a value is wrong, it tells you whether reading or normalisation failed.
Automatic validation
No extraction tool is one hundred percent accurate. What separates a useful automation from a dangerous one is the checks before writing.
- Amount consistency: net plus VAT must equal the total, with a one-cent tolerance for rounding; line items must add up to the net amount.
- VAT number: correct format for the supplier's country and, where one exists, a valid check digit (Italian VAT numbers have 11 digits with one).
- Supplier: on file; if not, the document stops.
- Dates: document date not in the future and not older than a threshold, due date after the document date.
- Duplicates: same supplier, number and date already recorded.
- IBAN, if extracted: checksum and comparison with the one on file. An IBAN that differs from usual is also a possible fraud signal and should always be confirmed with the supplier by phone.
- Purchase order: if one exists, quantities and prices compared with it.
Human review for uncertain cases
Documents that fail a check, or have below-threshold confidence on a critical field (total, VAT number, invoice number), go to a review queue: a sheet or a view in the accounting system with a link to the PDF, the extracted values and the reason it stopped. The reviewer corrects and approves; only then does the data move on.
Keep the threshold high at first, and in the first weeks review a sample of auto-approved documents too. Corrections show which suppliers or fields cause trouble and where a dedicated template is needed. The scenario itself also needs protection from technical errors, using the techniques in our article on error handling in Make.
Archiving and retention
Extraction doesn't replace the document. Store the original file in a stable location, named with supplier, number and date, and save the link with the extracted data. E-invoices are often subject to specific digital archiving rules that a PDF in a shared folder doesn't satisfy on its own. Check requirements with your accountant: this article is not tax advice.
Mind privacy as well: documents sent to a cloud service are processed by its provider. Choose an EU processing region where available and review the data processing terms.
Measuring accuracy and time saved
- Share of documents passed without corrections: the main indicator, tracked per supplier.
- Errors found after posting: should trend to zero; if they appear, a check is missing.
- Average time per document, measured before and after on a real sample.
- Cost per document of the extraction service, compared with the time saved.
Other workflows that start from documents and requests are collected in our automation guide. If you want data extraction set up for your own documents, we do it as part of our Make and Zapier automations.
- estrarre dati pdf
- ocr fatture
- document parsing
- automazione amministrativa
- intelligenza artificiale
- make
- controllo qualità dati
Frequently asked questions
Do I need OCR for electronic invoices?
Not if a structured version exists. In Italy, B2B invoices go through the SDI exchange system as FatturaPA XML, with fields already structured, and other countries are adopting similar e-invoicing. The PDF is just a readable copy. Read the XML and keep OCR and AI for documents with no structured version.
Is a dedicated invoice OCR service better than a general AI model?
For invoices and receipts, services such as Azure Document Intelligence, Google Document AI or Amazon Textract return standard fields and a confidence score. A general AI model is more flexible on varied documents, but must be constrained to a JSON schema and checked with rules.
How do I stop a misread value reaching the accounts?
With automatic validation before posting: net plus VAT equals total, VAT number format and check digit correct, plausible date, supplier on file, no duplicates. If a check fails or confidence is low, the document goes to review.
Does extracted data replace archiving the document?
No. Extraction gets data into your systems; the original document must still be retained under the applicable rules, which for e-invoices often require compliant digital archiving. Check requirements with your accountant. This article is not tax advice.
Sources
- Invoice data extraction - Document Intelligence — Microsoft Learn
- Processor list — Google Cloud
- Analyzing Invoices and Receipts — Amazon Web Services
- Formato FatturaPA — Agenzia delle Entrate - FatturaPA
Related articles
Automation · 7 min read
AI in Make and n8n: classifying emails and requests automatically
How to use an AI model inside Make or n8n to classify emails and requests: closed categories, JSON output, human review thresholds, privacy and costs.
Automation · 7 min read
Getting info@ under control: sorting incoming email with rules and automations
How to automatically sort a shared inbox: categories, Gmail and Outlook rules, assignments, tickets, attachments and response-time tracking.
Automation · 6 min read
AI Automation for E-commerce Product Descriptions: An Operational Guide for SEO & Conversions
Learn how to implement generative AI to create SEO-optimized and conversion-focused product descriptions at scale. A practical guide for e-commerce and marketers.
