PICKED FROM N8N.IO · DOCUMENTS & DATA ENTRY

Watches a Gmail inbox for supplier emails with PDF invoices, sends each PDF to LlamaParse to turn tables into text, then asks OpenAI to pull out the invoice fields. The results are added to a Google Sheet and the email is labelled so it is not processed twice.

Template by Jimleuk · 46.7k views on n8n.io · listed there as “Invoice data extraction with LlamaParse and OpenAI”

THE WORKFLOW17 NODES
LOpenAI Model{}Structured OutputParser↯Upload toLlamaParse@ReceivingInvoices▦Append toReconciliation S…↯Get ProcessingStatus⏸︎Wait to staywithin service l…⑂Is Job Ready?@Add "invoicesynced" Label↯Get ParsedInvoice Data≡Map Output✦Apply DataExtraction Rules⑂Should ProcessEmail?⊟Split Out Labels@Get Labels Names⊞Combine LabelNames⋈Email with LabelNames
DIFFICULTY
Advanced
NODES
17
USES AI
Yes
PUBLISHED
July 2024

001 / WHAT HAPPENS

  1. 01

    The Gmail trigger picks up emails with PDF attachments that do not yet carry the 'invoice synced' label.

  2. 02

    The PDF is uploaded to LlamaParse, and the workflow waits and checks until the job is ready.

  3. 03

    The parsed invoice text is fetched back from LlamaParse.

  4. 04

    OpenAI extracts the fields you define into structured data.

  5. 05

    The data is appended to a Google Sheet and the email gets the 'invoice synced' label.

WHO IT SUITS

Suits bookkeepers and small businesses that receive many supplier invoices by email and want them listed in a sheet before keying into accounting software.

CONNECTS

  • Gmail
  • LlamaParse
  • OpenAI
  • Google Sheets

002 / BEFORE YOU USE IT HERE

  • !Invoices go to LlamaParse and OpenAI, both overseas services, which is a cross-border disclosure under APP 8 of the Privacy Act if they hold personal information, so say so in your privacy policy.
  • !Create the 'invoice synced' Gmail label first, and replace the sender filter, Google Sheet URL, sheet name and extracted fields with your own.
  • !Needs a LlamaCloud account and a paid OpenAI API key. Check extracted amounts, ABN and GST against the original invoice before relying on them.
  • !This template uses older AI nodes, so test it on your current n8n version first.

LOCAL SWAP

Swap the Google Sheets node for the Xero node to create bills there, or for Microsoft Excel 365 if you use Excel.

Need n8n and the AI hosted in Australia? →

004 / QUESTIONS

Anything else is quicker to answer on a call. Thirty minutes, free, with the people who would build it.

Yes. Every template on this list is free on n8n.io. You need an n8n account (n8n Cloud or self-hosted) and accounts for the apps it connects to, some of which charge for API use.

We adapt templates to your systems, add approval steps where customers are involved, host n8n in Australia when the data calls for it and hand it over documented.

Book a free call→