This n8n workflow automates the process of parsing and extracting data from PDF invoices. With this workflow, accounts and finance people can realize huge time and cost savings in their busy schedules.

How it works

This workflow will watch an email inbox for incoming invoices from suppliers. It will download the attached PDFs and process them through a third-party service called LlamaParse.

LlamaParse is specifically designed to handle and convert complex PDF data structures such as tables to markdown. Markdown is easy to process for LLM models, making the data extraction by our AI agent more accurate and reliable.

The workflow exports the extracted data from the AI agent to Google Sheets once the job is complete.

Requirements

– The criteria of the email trigger must be configured to capture emails with attachments.
– The Gmail label “invoice synced” must be created before using this workflow.
– A LlamaIndex.ai account to use the LlamaParse service.
– An OpenAI account to use GPT for AI work.
– Google Sheets to save the output of the data extraction process, although this can be replaced with whatever your needs.

Customizing this workflow

This workflow uses Gmail and Google Sheets, but these can easily be swapped out for equivalent services such as Outlook and Excel. Not using Excel? Simply redirect the output of the AI agent to your accounting software of choice.