n8n Invoice Email Extraction
Invoice emails are a small, repetitive tax on every finance workflow. The PDF is attached, the amount is in the body, and someone copies four fields into a spreadsheet. Do it once a month and it is annoying. Do it across three vendors and two currencies and it becomes a reconciliation problem.
An n8n invoice email extraction workflow does not need to read every layout in the world. It needs to parse the structured invoices you actually receive, skip the ones it cannot read, and leave a clean row that a human can verify. That is a much smaller problem, and a much more reliable automation.
What workflow 08 does
The Lead Ops Pack includes Invoice email to Google Sheets as workflow 08. It watches Gmail for new messages, extracts amount, currency, vendor and invoice number with regex, and appends each invoice to a books tab. Emails without a parseable amount are skipped rather than guessed. The workflow was executed against a mock fixture before release.
The fail-closed choice is the important design decision. A wrong amount silently written to a ledger is worse than an unprocessed email. Skipped messages stay in the inbox, where a human can handle them.
Setup steps
- Create the books tab. Use one row per invoice with columns for received date, vendor, invoice number, amount, currency and source message ID. The message ID is your duplicate guard.
- Connect Gmail. Use a Gmail credential with read access. Scope it to the label or query you use for invoices; do not scan the whole mailbox.
- Tune the extraction patterns. The n8n invoice email extraction template handles common structured invoices: a labeled amount, a currency symbol or code, an invoice number pattern and a vendor name. Test against five real emails from your own accounts.
- Decide the skip rule. If the amount is missing or ambiguous, skip and log. Do not default to zero.
- Handle duplicates. Gmail can deliver the same thread twice; check the message ID or invoice number before appending.
- Run a batch. Process a week of invoice emails, compare the sheet against the source emails, and only then publish.
Where regex stops
Regex is a good fit for invoices generated by a billing system: fixed labels, predictable number formats, one amount per email. It is a poor fit for PDF attachments, scanned invoices, multi-line tables and vendors that change their template every quarter. The pack documents this limit explicitly: workflow 08 parses structured invoice emails today; PDF attachments need an added extraction step.
If most invoices are PDFs, put an OCR service in front of the parser and feed the text into the same Code node. Keep the sheet contract unchanged. That is the smallest useful extension.
The honest trade-off
A dedicated AP tool handles PDFs, approvals and accounting sync better, for a monthly fee. The case for n8n is different: you already run n8n, the invoice flow is one of ten small automations, and you want the data in a sheet you control without another subscription. For that case, a $29 pack with a working parser and a documented failure mode is the cheaper first step.
Get the pack
The Lead Ops Pack is ten importable n8n workflows for $29: lead enrichment, AI scoring, cold-email sync, invoice extraction, Stripe onboarding and more, plus setup docs, a credential map, a 50+ entry troubleshooting guide, a sample CSV and reference outputs. Core nodes only, tested on n8n 2.48.8, 14-day money-back guarantee.
Get the Lead Ops Pack: https://www.creem.io/product/prod_4vIP7lONOlaSuCPcW832Lm