How to extract invoice data into a bookkeeping sheet with n8n and OpenAI
The problem
Receipts and invoices arrive as photos and PDFs. Typing date, merchant, amount and VAT into a spreadsheet and filing the file is slow and error-prone.
Tools needed
- n8n
- OpenAI (vision)
- Google Drive
- Google Sheets
- A simple upload web page
Step-by-step recipe
- Build a small upload page that posts the file to an n8n webhook.
- Identify the user (the prototype looks up a token in a Google Sheet).
- Send images to OpenAI vision; for PDFs, extract the text first and then analyse it.
- Have the model return JSON (date, merchant, gross amount, VAT rate, category) and show it to the user to review and edit.
- On save, store the file in a Drive folder per user and month, and append the data to a yearly sheet.
Copyable prompt
Extract bookkeeping data from this invoice or receipt. Return JSON only:
{"date": "YYYY-MM-DD", "merchant": "...", "gross_amount": number, "currency": "...", "vat_rate": number|null, "vat_amount": number|null, "category": one of [CATEGORIES], "invoice_number": "..."|null}
Use null for anything not clearly printed on the document. Do not calculate or guess missing values.Original template written by AgentRecipes, not copied from the source. Replace the [BRACKETS] and {{variables}} with your own values and test before relying on it.
What the builder reported
A working prototype with a demo video. The source gives no accuracy or time-saving figures, and the public repo contains sanitised exports that need your own credentials and IDs.
These are the source author's own claims. AgentRecipes has not tested or verified them.
Watch out for
- The token lookup is a stand-in for real authentication; don't expose it publicly as is.
- Keep the human review step: extracted amounts and VAT rates must be checked before they reach your books.
Source
Original write-up: GitHub ↗
Found via Agent Use Cases: “Extract invoice data and file it into a bookkeeping sheet”. This recipe summarises the source in our own words; read the original for the full details. Link last checked 2026-10-15.
More finance & invoicing recipes
New agent recipes in your inbox
A short email with the newest automation recipes, each linked to its real-world source. No spam, unsubscribe anytime.