Skip to main content

Automate invoice processing with AI data extraction, Google Drive & Sheets

Workflow preview

Workflow preview
100%
Automate invoice processing with AI data extraction, Google Drive & Sheets preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

Automated Invoice Processing n8n Workflow Workflow Description This n8n workflow automates the complete processing of PDF invoices with AI powered data extraction. The workflow monitors a Goo...

Best for

  • Invoice Processing automation workflows
  • AI Summarization automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.googledrive, n8n-nodes-base.stickynote, @n8n/n8n-nodes-langchain.informationextractor, n8n-nodes-base.extractfromfile, n8n-nodes-base.splitinbatches, n8n-nodes-base.googlesheets, n8n-nodes-base.googledrivetrigger, @n8n/n8n-nodes-langchain.lmchatopenai

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Romain.

Original n8n.io source

1.1 Workflow description

Title
Automate invoice processing with AI data extraction, Google Drive & Sheets
Workflow name
Automate invoice processing with AI data extraction, Google Drive & Sheets

🧾 Automated Invoice Processing - n8n Workflow

πŸ“– Workflow Description

This n8n workflow automates the complete processing of PDF invoices with AI-powered data extraction. The workflow monitors a Google Drive folder, extracts important invoice data, and automatically organizes files in a structured filing system.


🎯 Features

  • πŸ” Automatic monitoring of a Google Drive folder for new PDF files
  • πŸ€– AI-powered data extraction from invoices (customer, amount, date, etc.)
  • πŸ“ Intelligent file sorting by year and month
  • πŸ“ Automatic renaming following a consistent schema
  • πŸ“Š Central documentation in Google Sheets

πŸ”§ Required Integrations

Required Accounts:

  • Google Drive (with folder permissions)
  • Google Sheets (with write permissions)
  • Google Gemini API (for AI data extraction)

Used n8n Nodes:

  • Google Drive Trigger
  • Google Drive (File Operations)
  • Google Sheets
  • Extract from File (PDF)
  • Information Extractor (LangChain)
  • Google Gemini Chat Model
  • Split in Batches

πŸ“‹ Workflow Steps in Detail

1. Monitoring & Triggering

  • Google Drive Trigger monitors a defined input folder
  • Automatically starts when new PDF files are detected
  • Split in Batches enables batch processing of multiple files

2. File Processing

  • GetFile downloads PDF files from Google Drive
  • ExtractFromPDF converts PDF content to text
  • Supports scanned documents as well

3. AI Data Extraction

The Information Extractor node with Google Gemini extracts:

  • Company name/sender
  • Customer name and customer number
  • Invoice number and date
  • Net and gross amount
  • Value-added tax
  • Article description
  • Month and year (for sorting)

4. Automatic Filing

  • GetYearFolder searches/creates year folders
  • GetMonthFolder searches/creates month folders
  • MoveFile moves invoice to correct folder
  • UpdateFileName renames file (schema: "Customer Month Year")

5. Documentation

  • AddToOverview enters all data into Google Sheets table
  • Enables central overview and analysis

βš™οΈ Setup Instructions

Step 1: Prepare Google Drive

Create the following folder structure in Google Drive:

πŸ“ [Input Folder] (e.g., "Invoices-Inbox")
πŸ“ [Main Folder] (e.g., "Accounting")
   └── πŸ“ 2024
       β”œβ”€β”€ πŸ“ January
       β”œβ”€β”€ πŸ“ February
       β”œβ”€β”€ πŸ“ March
       └── ... (all months)
   └── πŸ“ 2025
       └── ... (all months)

Step 2: Create Google Sheets Table

Create a spreadsheet with the following columns:

  • Customer Number
  • Customer
  • [Company Name] Location
  • Invoice Date
  • Invoice Number
  • VAT
  • Net Amount
  • Month
  • Year

Step 3: Configure Workflow

Configure Google Drive Trigger:
  • Select your input folder as "Folder to Watch"
  • Set "Event" to "fileCreated"
  • Activate the trigger
Search files and folders:
  • Select the same input folder as filter
Customize Information Extractor:
  • Adapt attribute names to your needs
  • Change company name in description
  • Adjust system prompt if needed
GetYearFolder & GetMonthFolder:
  • Set the correct folder ID for your main folder
  • Check query string for year/month search
AddToOverview:
  • Select your Google Sheets table
  • Map columns according to your table

πŸ”§ Customization Options

Extend Data Extraction:

Add more attributes in the Information Extractor node:

{
  "name": "Payment Terms",
  "description": "Days until payment due",
  "required": false
}

Customize File Naming:

Change the schema in the UpdateFileName node:

"{{ $('Information Extractor').item.json.output.InvoiceNumber }} - {{ $('Information Extractor').item.json.output.Customer }}"

Change Monitoring Interval:

In Google Drive Trigger under "Poll Times" select different intervals.


🚨 Important Notes

⚠️ Permissions:

  • Google Drive: Full access to configured folders
  • Google Sheets: Write permission for target table
  • Google Gemini: Valid API key required

πŸ“ Data Format:

  • Works with German number formats (comma as decimal separator)
  • Date format: YYYY-MM-DD
  • Supports various PDF formats

πŸ”„ Error Handling:

  • Workflow fails if folders are missing
  • Incomplete PDFs may lead to incomplete extractions
  • Check logs for troubleshooting

πŸ“Š Performance & Limitations

  • Processing time: 30-60 seconds per invoice
  • Supported formats: PDF (text and OCR)
  • Batch processing: Yes, multiple files simultaneously
  • AI accuracy: ~95% for standardized invoices

πŸ§ͺ Testing

  1. Run Test:

    • Upload a test PDF to the input folder
    • Monitor workflow execution in n8n
    • Check results in Google Sheets
    • Verify correct file movement and renaming
  2. Error Diagnosis:

    • For errors: check n8n logs
    • Consider Google API quotas
    • Validate folder permissions

πŸ“„ License & Support

This workflow can be used and customized freely. For configuration questions or issues, check the n8n community or Google API documentation.

Tip: Start with a few test invoices before using the workflow in production!

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - GetFile

Type / Role
n8n-nodes-base.googleDrive - googleDrive
Config choices
Version 3

Block 2 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 3 - Sticky Note3

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 4 - Information Extractor

Type / Role
@n8n/n8n-nodes-langchain.informationExtractor - informationExtractor
Config choices
Version 1

Block 5 - ExtractFromPDF

Type / Role
n8n-nodes-base.extractFromFile - extractFromFile
Config choices
Version 1

Block 6 - Loop

Type / Role
n8n-nodes-base.splitInBatches - splitInBatches
Config choices
Version 3

Block 7 - GetYearFolder

Type / Role
n8n-nodes-base.googleDrive - googleDrive
Config choices
Version 3

Block 8 - GetMonthFolder

Type / Role
n8n-nodes-base.googleDrive - googleDrive
Config choices
Version 3

Block 9 - MoveFile

Type / Role
n8n-nodes-base.googleDrive - googleDrive
Config choices
Version 3

Block 10 - UpdateFileName

Type / Role
n8n-nodes-base.googleDrive - googleDrive
Config choices
Version 3

Block 11 - AddToOverview

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.5

Block 12 - Sticky Note4

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 13 - Sticky Note5

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 14 - Search files and folders

Type / Role
n8n-nodes-base.googleDrive - googleDrive
Config choices
Version 3

Block 15 - Google Drive Trigger

Type / Role
n8n-nodes-base.googleDriveTrigger - googleDriveTrigger
Config choices
Version 1

Block 16 - OpenAI Chat Model

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenAi - lmChatOpenAi
Config choices
Version 1.2

Block 17 - Jahresordner schon vorhanden?

Type / Role
n8n-nodes-base.googleDrive - googleDrive
Config choices
Version 3

Block 18 - Jahresordner erstellen

Type / Role
n8n-nodes-base.googleDrive - googleDrive
Config choices
Version 3

Block 19 - Monatsordner einfΓΌgen

Type / Role
n8n-nodes-base.googleDrive - googleDrive
Config choices
Version 3

Block 20 - Split Out1

Type / Role
n8n-nodes-base.splitOut - splitOut
Config choices
Version 1

Block 21 - Monate als Liste

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 22 - Jahre auswΓ€hlen

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 23 - Split Out

Type / Role
n8n-nodes-base.splitOut - splitOut
Config choices
Version 1

Block 24 - Loop Over Items

Type / Role
n8n-nodes-base.splitInBatches - splitInBatches
Config choices
Version 3

Showing the first 24 of 29 workflow blocks. Download the JSON for the full node graph.

3. Summary Table

Workflow Automate invoice processing with AI data extraction, Google Drive & Sheets
Complexity advanced
Nodes 29
Categories Invoice Processing, AI Summarization
Author Romain
Published 11 Sept 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/8476/8476.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Automate invoice processing with AI data extraction, Google Drive & Sheets do?

Automated Invoice Processing n8n Workflow Workflow Description This n8n workflow automates the complete processing of PDF invoices with AI powered data extraction. The workflow monitors a Goo...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Invoice Processing, AI Summarization use case.