Ko Kitchen·2026

From supplier PDF to an idempotent Lexware invoice

An n8n workflow reads Hamberger supplier PDFs from Google Drive, preserves printed 7% and 19% tax buckets, creates the right Lexware document once, and attaches the source PDF.

Open public reference →

The problem

Supplier invoices arrived as PDFs. The manual path was repetitive: find the file, read the invoice, enter tax values, create a purchase document, and attach the original PDF. Repeating it by hand creates both delay and accounting risk.

The workflow

The n8n workflow lists matching PDFs in Google Drive and processes one file at a time. It extracts text, finds the invoice number, prefers the delivery date, parses German-formatted amounts, and uses the final footer rows because earlier pages contain running totals.

It creates separate 7% and 19% tax buckets from the printed document. It also detects a credit note from the document text or negative final amount, preserves its reference remark, and builds the corresponding Lexware payload.

The idempotency rule

Before writing, the workflow queries Lexware by voucher number. No matching document means create the voucher, then re-download and upload the PDF. An existing document does not create a duplicate. The workflow can instead fill in a missing PDF attachment when needed.

Why this matters

The valuable pattern is not PDF text extraction alone. It is a document pipeline that preserves the supplier’s printed totals, maps the result to the correct accounting type, avoids duplicate writes, and keeps the source evidence with the accounting record.

The public GitHub CLI, hamberger-dl, solves the earlier download problem. The n8n flow then takes already-downloaded invoices through accounting ingestion.