Automated Invoice Data Extraction from Google Drive to Google Sheets using AI - n8n Workflow

Use this robust n8n workflow to monitor Google Drive for new invoices, leverage Dumpling AI for accurate data extraction (including line items), and automatically input all structured data into Google Sheets. This n8n template eliminates manual data entry.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

Accounting & Finance Teams: Those who need to process high volumes of invoices quickly and accurately.
Operations Managers: Individuals looking to automate data entry for procurement or inventory tracking.
n8n Users: Users seeking advanced n8n templates integrating cloud storage, custom HTTP requests, and AI parsing.
Small Businesses: Organizations aiming to implement a fully automated bookkeeping intake system using an n8n node.

Overview

Manually transcribing invoice data—especially complex line items—is tedious, error-prone, and slow. This powerful n8n workflow solves this critical business problem by creating a hands-free process from document arrival to structured data logging. This specific n8n automation monitors a designated Google Drive folder. As soon as a new invoice (such as a PDF) is dropped in, the n8n workflow takes over, sends the file to the specialized Dumpling AI service for intelligent extraction based on a detailed prompt, and then meticulously splits and saves the resulting invoice header and line item data to a Google Sheet. This makes the entire n8n template perfect for scalable financial automation, ensuring reliable and immediate data availability for reporting and reconciliation. It demonstrates the power of a custom n8n node setup.

How it Works

This powerful n8n workflow operates through a precise sequence of steps, beginning with a dedicated n8n trigger:


  1. Trigger on File Upload: The process starts with the Google Drive Trigger n8n node, which constantly watches a specified 'invoice' folder for new file creations. This is the primary n8n trigger.

  2. Download File: Once a new file is detected, the workflow uses a Google Drive n8n node to download the file into the execution environment.

  3. Conversion to Base64: The file is then processed by an Extract From File n8n node, converting the binary file data into a Base64 string. This format is required for the external API call.

  4. AI Extraction: An HTTP Request n8n node sends the Base64 data to Dumpling AI’s extraction endpoint. A specific, detailed prompt is included in the JSON body, instructing the AI to identify crucial fields like order number, PO number, addresses, and the full list of line items.

  5. Response Parsing: The response from Dumpling AI often contains the extracted data as a JSON string within a larger response. A specialized Code n8n node is used to JSON.parse this string, turning it into a usable structured data object within the n8n workflow.

  6. Split Line Items: The critical Split Out n8n node takes the extracted array of items and transforms each line item into an individual item within the n8n workflow. This prepares the data for row-by-row logging.

  7. Data Logging: Finally, the Google Sheets n8n node appends the data. It strategically combines header information (like PO number, which is common to all items and pulled from the previous node using an expression) and the specific line item details (model, quantity, price) to create a clean, comprehensive ledger entry for every product listed on the invoice.

Installation Guide

To deploy this high-value n8n template, follow these steps:


  1. Import the n8n workflow: Copy the provided JSON and import it directly into your n8n instance.

  2. Google Drive Credentials: Configure the Google Drive credentials for the Google Drive Trigger and Download Invoice File nodes. Specify the exact folder path where your invoices will be uploaded.

  3. Google Sheets Credentials: Set up the Google Sheets credentials in the Save Data to Google Sheet n8n node. Select your target spreadsheet and worksheet where the extracted data should be appended.

  4. Dumpling AI API Key: Configure the HTTP Header Authentication for the Send file to Dumpling AI for Data Extraction n8n node. This requires your Dumpling AI API key to be set up as a generic credential type, likely as a 'Authorization' header.

  5. Activation: Once all credentials and folder/sheet configurations are complete, activate the n8n workflow to begin automatic monitoring and processing.

Node Details

Google Drive Trigger – Watch Folder for New Files (n8n trigger): The starting n8n node. It polls Google Drive every minute, looking for newly created files in the designated folder (invoice-n8n).
Download Invoice File (Google Drive n8n node): Uses the file ID provided by the trigger to fetch the actual invoice file content.
Convert invoice File to Base64 (Extract From File n8n node): Converts the binary file into a Base64 string, stored in the data property, which is necessary for the AI API request.
Send file to Dumpling AI for Data Extraction (HTTP Request n8n node): This sends a POST request to the AI service, providing the Base64 file and a detailed prompt to ensure structured JSON output, leveraging the power of AI automation in this n8n template.
Parse Dumpling AI JSON Response (Code n8n node): Custom JavaScript code (JSON.parse(raw)) converts the text string containing the AI's extracted JSON into a functional JSON object for downstream use in the n8n workflow.
Split line Items from Invoice (Split Out n8n node): Separates the items array from the invoice into multiple individual data items, allowing each line item to be logged as a unique row in the spreadsheet.


  • Save Data to Google Sheet (Google Sheets n8n node): Appends rows to the selected Google Sheet. It uses complex expressions to map static invoice fields (like PO number) retrieved from the parsing node and dynamic line item fields (model, quantity) from the currently iterating item.

Related n8n Workflows

Free

Nodes: 8 Nodes
Updated: December 26 2025
View all
Created by
Yang
Yang

Featured*