Skip to main content

Extract and process invoices with GPT-4, Google Drive, and Google Sheets

Workflow preview

Workflow preview
100%
Extract and process invoices with GPT-4, Google Drive, and Google 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

This template is a fully automated AI invoice processing workflow for n8n. It watches a Google Drive folder for new invoice PDFs, extracts a...

Best for

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

Tools used

n8n-nodes-base.googlesheets, n8n-nodes-base.googlesheetstool, n8n-nodes-base.googledrive, @n8n/n8n-nodes-langchain.outputparserstructured, @n8n/n8n-nodes-langchain.lmchatopenai, n8n-nodes-base.extractfromfile, @n8n/n8n-nodes-langchain.memorybufferwindow, n8n-nodes-base.stickynote

Source and attribution

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

Original n8n.io source

1.1 Workflow description

Title
Extract and process invoices with GPT-4, Google Drive, and Google Sheets
Workflow name
Extract and process invoices with GPT-4, Google Drive, and Google Sheets

This template is a fully automated AI invoice processing workflow for n8n. It watches a Google Drive folder for new invoice PDFs, extracts all key information using an AI Agent, assigns the correct booking account, saves the renamed invoice in the right Drive folder, and updates your Google Sheets booking list.

A perfect starter template if you want to build your own AI-powered accounting automation.

What this workflow does

  • Monitors a Google Drive folder for new invoice PDFs.
  • Downloads and extracts invoice text from the uploaded PDF.
  • Uses an AI Agent (OpenAI + Structured Output Parser) to extract:
    • invoice date
    • vendor
    • currency
    • total amount
    • invoice number
    • booking text
    • booking account
    • matching Google Drive folder ID
  • Automatically renames the PDF to a clean, consistent format (e.g. 250912 Vendor.pdf).
  • Saves the invoice into the correct accounting folder in Google Drive.
  • Updates your booking list in Google Sheets with all extracted fields.
  • Moves the processed invoice to an output folder to avoid duplicates.

Everything runs hands-free after setup.

Key features

  • 🧠 AI Invoice Reading using OpenAI + LangChain
  • 📑 Structured Output Parser guarantees clean, validated fields
  • 📁 Automated Google Drive File Routing
  • 📊 Google Sheets logging for accounting records
  • 🔄 File movement logic to keep input/output folders organized
  • ⚙️ Chart of Accounts integration from your Google Sheet
  • 🟦 Works out of the box with Invoice Agent – Folder Structure Setup (recommended)

Typical use cases

  • Automated accounting workflows
  • Pre-processing invoices before importing into ERP or sevDesk
  • AI-powered invoice extraction for small businesses or freelancers
  • Structured archiving of invoices for tax and audit requirements
  • Fully automated Google Drive invoice inbox

How to use this template

  1. Connect your Google Drive & Sheets credentials in all relevant nodes.
  2. Select your: • Input folder (where invoices are uploaded) • Output folder (where processed invoices go) • Folder structure sheet + booking accounts sheet
  3. Upload any invoice PDF into the input folder.
  4. The workflow starts automatically and processes the invoice end-to-end.

Requirements

• Google Drive OAuth2 • Google Sheets OAuth2 • OpenAI API key • A Google Sheet containing your chart of accounts • A prepared folder structure (use the “Google Drive Structure Setup” template)

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 - Update Booking List

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

Block 2 - Chart of Accounts

Type / Role
n8n-nodes-base.googleSheetsTool - googleSheetsTool
Config choices
Version 4.7

Block 3 - Save to Drive

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

Block 4 - Structured Output Parser

Type / Role
@n8n/n8n-nodes-langchain.outputParserStructured - outputParserStructured
Config choices
Version 1.3

Block 5 - OpenAI Chat Model

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

Block 6 - Extract from File

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

Block 7 - Simple Memory

Type / Role
@n8n/n8n-nodes-langchain.memoryBufferWindow - memoryBufferWindow
Config choices
Version 1.3

Block 8 - Sticky Note3

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

Block 9 - Google Drive Trigger

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

Block 10 - Edit Fields

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

Block 11 - Move file

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

Block 12 - Download file

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

Block 13 - Sticky Note

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

Block 14 - Sticky Note1

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

Block 15 - Sticky Note2

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

Block 16 - Invoice Agent

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 2.2

Block 17 - Sticky Note4

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

3. Summary Table

Workflow Extract and process invoices with GPT-4, Google Drive, and Google Sheets
Complexity advanced
Nodes 17
Categories Invoice Processing, AI Summarization
Author Wolfgang Renner
Published 20 Nov 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/11058/11058.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 Extract and process invoices with GPT-4, Google Drive, and Google Sheets do?

This template is a fully automated AI invoice processing workflow for n8n. It watches a Google Drive folder for new invoice PDFs, extracts a...

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.