This n8n workflow automates the process of extracting data from invoice PDFs received via email and storing it in a Google Sheet for reconciliation. It streamlines invoice processing by leveraging AI, LlamaParse, and Gmail integrations.
The workflow starts by monitoring Gmail for incoming emails from specific senders with PDF attachments, indicative of invoices. When a new invoice email arrives, it checks if the email has already been processed by looking for a specific label ‘invoice synced’. If not processed, it proceeds to extract the PDF attachment.
Next, the workflow uploads the invoice PDF to LlamaParse’s API, which converts the complex PDF into Markdown format while preserving tables and structures. It then polls the LlamaIndex API to check the parsing job status, waiting until the document is ready.
Once the parsed data is available, it retrieves the Markdown output, which is then fed into an AI model to extract structured invoice details according to predefined schemas.
The extracted data, including invoice date, number, supplier info, customer info, line items, and totals, are then formatted and appended as a new row in a specified Google Sheet. After successful data extraction, the workflow labels the original email with ‘invoice synced’ to prevent duplicate processing.
Additional nodes collect label names for context and ensure smooth operation, while sticky notes provide guidance throughout the process.
This workflow is particularly useful for accounting teams, finance automation, or any business aiming to automate invoice data entry, reducing manual effort, minimizing errors, and enhancing operational efficiency.
Reviews
There are no reviews yet.