← Back to projectsAUTOMATION WITH N8N · INTERACTIVE DEMO

From a folder of PDFs
to a reliable record.

A workflow that picks up invoices from Google Drive, extracts their data with an AI model hosted on a private server, validates them with business rules, logs them in a spreadsheet and files each document in its month folder.

n8nGemma · llama.cppDeepSeekPythonGoogle DriveGoogle SheetsGmail
THE JOURNEY

Read. Interpret.
Validate. File.

Designed to run unattended: it works in batches, tolerates network and model failures, never duplicates records and leaves people only the cases that truly need judgment.

42Workflow nodes
54Connections
02AI models: local and fallback
EXPLORE THE AUTOMATION

The process, from the inside.

Open full viewer

Pick a stage or select a node to see what it does, how many times it retries and where it goes if it fails. The reddish lines are the error outputs.

Open them here or from their nodes in the viewer:
DESIGN DECISIONS
01

Streaming so slow invoices are not lost

Because of the volume of invoices, the inference cost that would mean on a pay-per-use service, and data governance, the model runs on a private, on-premise server. A Cloudflare Tunnel securely connects that server to the n8n instance without exposing ports to the internet. The tunnel enforces a response timeout: if the server goes about two minutes without sending data, the request is dropped, and long invoices took longer than that. By requesting a streamed response, the model sends each fragment as soon as it is generated, the connection never goes silent and the workflow reassembles the result.

02

AI proposes, code decides

The model only extracts. If the local model cannot process an invoice or returns an error, a DeepSeek fallback model repeats the extraction with the same instructions, and the result goes through the same filter. Whether an invoice is accepted depends on explicit, auditable rules; low confidence or an invalid CUFE sends it to a person.

03

Nothing fails silently

Every node that can fail has an error output: the file ends up logged, in the review folder and in the summary, and the batch carries on with the next one.

04

Everything is logged and visible

Every invoice, its line items and every case sent to review are written to a Google spreadsheet, with no duplicates even if a file is reprocessed. On top of that log, a dashboard summarizes spend by supplier, the monthly trend and how many invoices needed review: the data is ready to be consulted without opening a single PDF.

THE NEXT STEP

Good ideas deserve
a good plan.

Let's talk about yours