PDF-Workflows: Automatically ingest incoming invoices into ERP
Manually capturing incoming invoices is the equivalent of cranking the window handle in a car — it works, but there’s no longer any reason to do it. With OCR, a local LLM and a short n8n workflow, it runs by itself.
The Pipeline
Email input → Paperless-ngx → OCR & classification → n8n → ERP posting
- Email input: Suppliers send PDF invoices to
rechnung@unternehmen.at. NoSpamProxy filters them beforehand, and the mail server forwards them to a Paperless-ngx consumption folder. - Paperless-ngx: Reads the PDF, performs OCR to recognize the text, classifies the document type and supplier, and extracts key data — amount, invoice date, invoice number.
- n8n workflow: Retrieves the extracted data via the Paperless API, validates it against the Winline customer master, and posts the invoice in the financial accounting.
- Archive: The original PDF remains in Paperless, revision-proof and searchable.
Why on-prem?
Invoices contain sensitive information: prices, terms, supplier relationships. Sending them to a cloud OCR service is legally tricky under data protection rules — and under NIS2 it may even be mandatory to report.
Paperless-ngx runs as a Docker container on your own infrastructure. The LLM for handling unstructured deviations (different invoice formats, special cases) runs locally on the GPU — the data never leaves the premises.
The local LLM as fallback classifier
Standard invoices are reliably recognized by Paperless-ngx using trained classification. For special formats, foreign invoices and free-text corrections, a local LLM steps in:
Extract from the following invoice text:
- Invoice date (YYYY-MM-DD)
- Net amount (numerically)
- Invoice number
- Supplier (name as stored in the ERP)
This runs via the on-prem vLLM API — no data sent to OpenAI, no compliance concerns.
What still isn’t fully automatic
Approval. Substantive review — “was the goods actually delivered?” — still requires a human. But the human finds a pre-classified invoice with all data already in the ERP and only needs to click “Approve” — instead of spending 10 minutes typing.
Conclusion
PDF workflows are the low-hanging fruit of ERP automation. The return on investment for any SME processing more than 50 incoming invoices per month is under one year — provided you do it on-prem.
From what volume does an automated PDF invoice pipeline pay off for us?+
From around 50 incoming invoices per month, the return on investment is typically under one year. The pipeline of Paperless-ngx, n8n, and a local LLM takes over the typing, classifies supplier and amount, and posts the invoice into the ERP. Below that the benefit is small; above it, the automation makes purchasing measurably faster and noticeably relieves the accounting team.
Why must this run on-prem rather than in the cloud?+
Invoices contain prices, terms, and supplier relationships — sensitive information whose dispatch to a cloud OCR service is legally tricky and, under NIS2, may even be mandatory to report. Paperless-ngx runs as a Docker container on your own infrastructure, and the LLM for special formats runs locally on the GPU. That keeps the data on-premises and removes the compliance question entirely.
What still isn’t automatic and needs a human?+
Substantive approval. Checking whether the goods were actually delivered still requires a person. That person, however, finds a pre-classified invoice with all data already in the ERP and only needs to click Approve, instead of typing for ten minutes. The local LLM also catches foreign invoices and deviating formats as a fallback classifier that Paperless-ngx alone would not reliably recognize.