Skip to main content

Classify & auto-sort invoices in Google Drive with GPT-4o

Workflow preview

Workflow preview
100%
Classify & auto-sort invoices in Google Drive with GPT-4o preview
Open on n8n.io

Important notice

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

1. Workflow Overview

Description: Automatically classify invoices by industry (Retail, Manufacturing, or EdTech) using GPT 4o powered AI parsing in this intelligent n8n automation template. Designed for teams managing ...

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.manualtrigger, @n8n/n8n-nodes-langchain.agent, @n8n/n8n-nodes-langchain.lmchatazureopenai, n8n-nodes-base.splitinbatches, n8n-nodes-base.extractfromfile, n8n-nodes-base.switch, 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 Rahul Joshi.

Original n8n.io source

1.1 Workflow description

Title
Classify & auto-sort invoices in Google Drive with GPT-4o
Workflow name
Classify & auto-sort invoices in Google Drive with GPT-4o

Description:

Automatically classify invoices by industry (Retail, Manufacturing, or EdTech) using GPT-4o-powered AI parsing in this intelligent n8n automation template. Designed for teams managing high-volume billing data, this workflow fetches invoices from Google Drive, extracts PDF text, classifies each document using AI, and automatically moves files to the correct folder based on the predicted industry.

This smart auto-sorting system turns your invoice processing into a zero-touch AI workflow—ideal for finance teams, document processing agencies, and operations managers dealing with multi-client or multi-industry invoicing pipelines.

What This Template Does (Step-by-Step)

📂 Google Drive Search

  • Scans a designated folder (e.g., “Incoming Invoices”)
  • Collects all PDF files available for classification

⬇️ Download & Extract PDF Text

  • Downloads each file using Google Drive API
  • Extracts invoice text from PDFs using the “Extract from File” node

🔁 Batch Handling

  • Loops through each invoice in a batch using the SplitInBatches node
  • Ensures each document is processed one at a time

🧠 GPT-4o Mini via LangChain Agent

  • Sends extracted invoice content to GPT-4o AI
  • Classifies the document into one of: Retail, Manufacturing, EdTech
  • Returns clean, structured classification output

🔀 Smart Switch Logic

  • Evaluates the classification result
  • Routes the invoice to the correct folder based on its predicted industry

📁 Auto-Move Files

  • Uses Google Drive API to move files into industry-specific folders:
  • Retail → Folder A
  • Manufacturing → Folder B
  • EdTech → Folder C

Required Integrations:

✅ Google Drive (OAuth2 authentication) ✅ Azure OpenAI (GPT-4o or compatible model) ✅ LangChain agent setup in n8n

Best For:

🧾 Finance teams classifying vendor or client invoices 🏭 Companies handling multi-industry procurement 🧠 AI automation agencies building custom document sorters 🗂️ Back-office automation for Google Drive file workflows

Key Benefits:

💡 No manual labeling required — AI classifies based on content 📦 Automatically moves files to clean, organized folders 🔄 Works in batch mode for bulk invoice handling 💬 Simple prompt customization for other classification types 🧠 GPT-4o-powered classification ensures high accuracy

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 - Download File

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

Block 2 - When clicking ‘Execute workflow’

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

Block 3 - AI Agent

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

Block 4 - Azure OpenAI Chat Model

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

Block 5 - Loop Over Items

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

Block 6 - Extract from File

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

Block 7 - Switch

Type / Role
n8n-nodes-base.switch - switch
Config choices
Version 3.2

Block 8 - Search files and folders

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

Block 9 - Manufacturing

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

Block 10 - Retail

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

Block 11 - EdTech

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

Block 12 - Sticky Note

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

Block 13 - Sticky Note1

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

Block 14 - Sticky Note2

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

Block 15 - Sticky Note3

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

Block 16 - Sticky Note4

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

Block 17 - Sticky Note5

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

Block 18 - Sticky Note6

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

3. Summary Table

Workflow Classify & auto-sort invoices in Google Drive with GPT-4o
Complexity advanced
Nodes 18
Categories Invoice Processing, AI Summarization
Author Rahul Joshi
Published 30 Jul 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/6682/6682.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 Classify & auto-sort invoices in Google Drive with GPT-4o do?

Description: Automatically classify invoices by industry (Retail, Manufacturing, or EdTech) using GPT 4o powered AI parsing in this intelligent n8n automation template. Designed for teams managing ...

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.