Use this powerful n8n workflow template to automatically process invoice attachments received via Gmail. Upload PDFs to Google Drive, leverage OpenAI for structured data extraction, and log all details accurately in Google Sheets using specialized n8n nodes.
Download this n8n workflow template and start using it instantly.
Accounting and Finance Professionals seeking to automate tedious invoice reconciliation.
Small Business Owners needing an efficient, error-free method to track expenses.
n8n automation specialists looking for advanced n8n templates integrating AI and core logic nodes.
Teams wanting to eliminate manual data entry from PDF documents using an intelligent n8n workflow.
Manually processing invoices from email attachments is time-consuming and prone to errors. This specialized n8n workflow solves this by creating a fully automated pipeline. The moment an invoice hits your designated inbox, the n8n trigger captures it. The PDF is securely stored in Google Drive, renamed for organizational clarity, and then subjected to AI-powered data extraction using the OpenAI n8n node. By utilizing a Structured Output Parser, this n8n workflow guarantees clean, formatted data ready for insertion into Google Sheets, drastically improving operational efficiency and data accuracy. This particular n8n template demonstrates the high potential of combining file operations with advanced large language models within the n8n automation environment.
This n8n workflow begins with the Gmail Trigger node, which constantly polls your specified inbox for new, unread emails and automatically downloads any attachments.
Only invoice mails with attachments) checks if the email contains attachments or is a multipart message, filtering out irrelevant correspondence.SupplierNameinvoice2024-01-15.pdf) and moved to the correct specified folder using dedicated Google Drive n8n node actions.Extract from File n8n node performs Optical Character Recognition (OCR) to convert the PDF content into plain text.gpt-4o OpenAI Model, to apply custom extraction rules to the raw PDF text. This step includes dynamic input, such as creating a hyperlink back to the newly saved file in Google Drive (Fichero).Structured Output Parser n8n node, which strictly enforces a specific JSON schema (date, number, string) ensuring reliable data integrity.Append to Reconciliation Sheet n8n node. Finally, the original email is marked as 'Read' using the Gmail n8n node, completing this robust n8n workflow.To deploy this comprehensive n8n workflow, follow these steps:
Setup1 n8n node, replace the placeholder urltodrive_folder value with the actual folder ID where you want to store your incoming invoices.Append to Reconciliation Sheet n8n node, select your target Google Sheet document and specify the sheet name or GID.This n8n workflow utilizes several powerful n8n node types:
Gmail Trigger: The essential starting n8n trigger. It is configured to only process unread messages and automatically downloads attachments, ensuring the n8n workflow starts immediately upon invoice arrival.
If n8n node (Only invoice mails with attachments): Implements core logic flow control. Checks for multipart/mixed content-type or if the attachments array is non-empty, directing only relevant emails down the processing path.
HTTP Request n8n node (Upload PDF to Drive1): Used for efficiently uploading the binary PDF data directly to the Google Drive API, a key step in this n8n workflow.
Google Drive n8n node: Used for subsequent file operations, specifically update (renaming the file using dynamic expressions) and move (placing the file in the designated folder).
Extract from File n8n node: Performs PDF text extraction, converting the visual invoice data into usable text input for the AI n8n node.
LangChain LLM Chain n8n node (Apply Data Extraction Rules): This crucial n8n node defines the extraction logic and prompt. It instructs the large language model (LLM) to extract structured fields (Date, Price) from the textual invoice data.
Structured Output Parser n8n node: Attached to the LangChain LLM Chain, this ensures the AI output strictly adheres to the defined JSON schema, making the data perfectly ready for Google Sheets.
Google Sheets n8n node (Append to Reconciliation Sheet): The final action n8n node, taking the validated, structured data and appending it to the reconciliation sheet.
Automate invoice processing using this robust n8n workflow. It uses an AI Text Extractor n8n node for data extraction from attachments, validates results against Google Sheets master data, and automatically files PDFs in Google Drive. Deploy this n8n template for finance automation.

Use this powerful n8n workflow to automatically extract structured data from PDF invoices using AI (OpenRouter), validate costs against Google Sheets master data, and log all financial discrepancies.

Automate invoice processing using this powerful n8n workflow. Extract structured data from PDF emails using GPT-4o, validate existence in PostgreSQL, and send alerts via Discord.

Build a sophisticated multi-agent feedback loop in n8n using OpenAI. This n8n workflow automatically generates, criticizes, and refines creative content like branding assets using powerful n8n templates.

Use this utility n8n workflow template to extract a specific key and value from a JSON object using its index position. Features custom Python n8n node logic for enhanced data transformation.








































