Automated Invoice Processing with AI and Email Integration

somdn_product_page

This n8n workflow automates the extraction of invoice data from PDF attachments received via Gmail and uploads the parsed information into a Google Sheet for easy reconciliation. It leverages advanced AI models and the LlamaParse service to handle complex PDF invoices, including tables and embedded objects, making data extraction accurate and efficient.

The process begins with the workflow listening for new emails from a specific sender (‘invoices@paypal.com’) containing PDF attachments that are not yet processed, indicated by a custom Gmail label. When such an email arrives, the workflow downloads the attachment and sends it to the LlamaParse API to convert the PDF into Markdown format, preserving important data structures like tables.

Next, the Markdown file is fetched and processed with an AI language model (GPT-3.5 Turbo) to extract structured invoice data according to a predefined schema. This structured data includes invoice dates, numbers, supplier and customer details, line items, and totals.

Once the data is extracted, it is appended to a Google Sheets document for record-keeping and further analysis. To prevent duplicate processing, the workflow adds the ‘invoice synced’ label back to the original email. It also checks the status of the LlamaIndex parsing job to ensure the extraction is complete before proceeding.

This automated setup is ideal for businesses looking to streamline their invoice processing, reduce manual data entry, and maintain organized records by integrating email, AI, and cloud-based parsing seamlessly.

Node Count

>20 Nodes

Nodes Used

@n8n/n8n-nodes-langchain.chainLlm, @n8n/n8n-nodes-langchain.lmOpenAi, @n8n/n8n-nodes-langchain.outputParserStructured, aggregate, gmail, gmailTrigger, googleSheets, httpRequest, if, merge, set, splitOut, stickyNote, switch, wait

Reviews

There are no reviews yet.

Be the first to review “Automated Invoice Processing with AI and Email Integration”

Your email address will not be published. Required fields are marked *