🔓 Unlock all 10,000+ workflows & prompts free Join Newsletter →
✅ Full access unlocked — explore all 10,000 AI workflow and prompt templates Browse Templates →
Home n8n Workflow
January 22, 2026

Google Drive + Azure OpenAI: invoices filed correctly

Lisa Granqvist Partner Workflow Automation Expert

Your “Incoming Invoices” folder starts clean. Then one busy week hits, filenames get weird, and suddenly people can’t find anything. You waste time opening PDFs just to figure out where they belong.

This is the kind of mess that finance managers complain about first, but ops leads feel it too. And if you run an agency handling client billing, it’s even worse. This Drive invoice filing automation sorts invoices correctly without you playing document detective.

Below you’ll see exactly how the workflow classifies each invoice using Azure OpenAI, routes it to the right folder, and keeps your Google Drive tidy with almost no manual effort.

How This Automation Works

The full n8n workflow, from trigger to final output:

n8n Workflow Template: Google Drive + Azure OpenAI: invoices filed correctly

The Problem: Invoices land in Drive, then everything gets misfiled

Invoice filing sounds simple until you’re handling a steady stream of PDFs from different vendors, formats, and industries. One invoice says “INV_1049.pdf,” another is “April statement,” and the content inside is the only reliable clue. So you open files, skim line items, guess the category, then drag-and-drop into “Retail” or “Manufacturing” (or whatever your system is). Multiply that by 20 invoices on a Monday and you’ve burned about an hour on pure sorting, plus the stress of knowing you’ll miss one.

It adds up fast. Here’s where it breaks down in real teams.

  • Someone files based on the filename, and the invoice ends up in the wrong client or industry folder.
  • Approvals get delayed because the invoice is “somewhere in Drive” but not where anyone expects it.
  • Your clean folder structure slowly collapses, and month-end becomes a scavenger hunt.
  • Even careful people make mistakes when they’re doing repetitive sorting for an hour.

The Solution: Classify each invoice with AI, then move it automatically

This workflow watches a Google Drive folder where invoice PDFs arrive (think “Incoming Invoices”). When you run it, it finds the PDFs in that folder, pulls down each file, and extracts the text from the PDF so there’s real content to analyze. Then an AI agent powered by Azure OpenAI reads that text and classifies the invoice into one of three industries: Retail, Manufacturing, or EdTech. Once the classification comes back, n8n routes the file through a simple decision step and moves it into the correct destination folder in Google Drive. Clean inputs. Clean outputs. Honestly, it feels like hiring a meticulous assistant who never gets bored.

The workflow starts with a Drive search and file download. From there, it extracts PDF text and processes invoices one-by-one in a controlled loop. Finally, a Switch routes the invoice to the right Drive folder so your filing stays consistent even when volume spikes.

What You Get: Automation vs. Results

Example: What This Looks Like

Say your team processes 50 invoices a week. Manually, even a quick “open PDF, scan header, decide folder, move file” takes maybe 2 minutes each, so you’re spending around 100 minutes weekly just sorting. With this workflow, you run one job: about 2 minutes to start it and spot-check a couple outcomes, then let processing happen in the background. You get roughly an hour and a half back, and the bigger win is fewer downstream errors.

What You’ll Need

  • n8n instance (try n8n Cloud free)
  • Self-hosting option if you prefer (Hostinger works well)
  • Google Drive to store, find, and move PDFs
  • Azure OpenAI to classify invoices by content
  • Azure OpenAI API access (get it from the Azure Portal)

Skill level: Intermediate. You’ll connect accounts, set folder IDs, and test on a small batch first.

Don’t want to set this up yourself? Talk to an automation expert (free 15-minute consultation).

How It Works

A run is triggered. In this template it starts with a manual trigger, which is perfect for testing. Many teams switch this to a schedule later (for example, every hour) once they trust the results.

Drive files are collected and opened. n8n searches your designated “Incoming Invoices” folder in Google Drive, then downloads each PDF so it can be processed reliably.

The PDF text gets extracted and classified. The workflow pulls text from the file, then sends the content to an AI agent using an Azure OpenAI chat model. The agent returns a clean classification label like “Retail,” not a long explanation.

The invoice is routed and moved. A Switch checks the classification and moves the original PDF into the right destination folder (Retail, Manufacturing, or EdTech). Then the workflow moves to the next invoice in the batch.

You can easily modify the industry categories to match your chart of accounts or client list based on your needs. See the full implementation guide below for customization options.

Step-by-Step Implementation Guide

Step 1: Configure the Manual Trigger

This workflow starts with a manual execution to let you validate the end-to-end invoice classification before automating.

  1. Add or verify the Manual Run Trigger node at the start of the workflow.
  2. Keep default settings in Manual Run Trigger (no parameters required).
  3. Connect Manual Run Trigger to Find Drive Items.

Step 2: Connect Google Drive

Google Drive provides the invoice files and destination folders for routing.

  1. Open Find Drive Items and set Resource to fileFolder and Return All to true.
  2. In Find Drive Items, set the folder filter Folder ID to your source folder: [YOUR_ID].
  3. In Retrieve File Content, set Operation to download and keep Authentication as oAuth2.
  4. Set File ID in Retrieve File Content to {{ $json.id }}.
  5. Connect Google Drive credentials to all Google Drive nodes: Find Drive Items, Retrieve File Content, Move to Manufacturing Folder, Move to Retail Folder, and Move to EdTech Folder.

Credential Required: Connect your googleDriveOAuth2Api credentials.

Step 3: Extract and Iterate Invoice Text

Invoices are downloaded, parsed to text, and processed one at a time for classification.

  1. In Parse PDF Content, set Operation to pdf.
  2. Connect Retrieve File Content to Parse PDF Content.
  3. Connect Parse PDF Content to Iterate Records.
  4. Leave default settings in Iterate Records to process each invoice one by one.

⚠️ Common Pitfall: If Parse PDF Content receives non-PDF files, the extraction can fail. Ensure your source folder only contains PDFs.

Step 4: Set Up AI Classification

The agent uses Azure OpenAI to classify invoices into Retail, Manufacturing, or EdTech based on the extracted text.

  1. Open Invoice Classifier Agent and set Text to {{ $json.text }}.
  2. Ensure the system prompt in Invoice Classifier Agent instructs the model to return only Retail, Manufacturing, or EdTech.
  3. Confirm Azure Chat Engine is connected as the language model for Invoice Classifier Agent and set Model to gpt-4o-mini.
  4. Connect Iterate Records to Invoice Classifier Agent.

Credential Required: Connect your azureOpenAiApi credentials.

Azure Chat Engine is connected as the language model for Invoice Classifier Agent — ensure credentials are added to Azure Chat Engine, not the agent node.

Step 5: Configure Routing and Folder Moves

Based on the AI output, the invoice is moved into the appropriate industry folder.

  1. In Route by Industry, ensure the three rules check {{ $json.output }} equals Retail, Manufacturing, and EdTech.
  2. Connect Invoice Classifier Agent to Route by Industry.
  3. In Move to Retail Folder, set Operation to move and File ID to {{ $('Retrieve File Content').item.json.id }}.
  4. In Move to Manufacturing Folder, set Operation to move and File ID to {{ $('Retrieve File Content').item.json.id }}.
  5. In Move to EdTech Folder, set Operation to move and File ID to {{ $('Retrieve File Content').item.json.id }}.
  6. Set the Folder ID for each move node to your target folders: [YOUR_ID] for Retail, Manufacturing, and EdTech.

⚠️ Common Pitfall: If the move nodes point to the wrong folder IDs, files may disappear from the expected location. Double-check each destination folder mapping.

Step 6: Test and Activate Your Workflow

Run a manual test to confirm files are classified and moved correctly before enabling the workflow.

  1. Click Execute Workflow on Manual Run Trigger to start a test run.
  2. Verify that Find Drive Items returns invoice files and Retrieve File Content downloads each file.
  3. Check Invoice Classifier Agent output for exact values: Retail, Manufacturing, or EdTech.
  4. Confirm each invoice is moved by the correct node: Move to Retail Folder, Move to Manufacturing Folder, or Move to EdTech Folder.
  5. When satisfied, toggle the workflow to Active for production use.
🔒

Unlock Full Step-by-Step Guide

Get the complete implementation guide + downloadable template

Common Gotchas

  • Google Drive credentials can expire or need specific permissions. If things break, check the n8n Credentials page and the Google OAuth consent/scope settings first.
  • If you’re using Wait nodes or external rendering, processing times vary. Bump up the wait duration if downstream nodes fail on empty responses.
  • Default prompts in AI nodes are generic. Add your brand voice early or you’ll be editing outputs forever.

Frequently Asked Questions

How long does it take to set up this Drive invoice filing automation?

About 30 minutes if your Drive folders and Azure access are ready.

Do I need coding skills to automate Drive invoice filing?

No. You’ll mostly connect accounts and paste in a few folder IDs. The only “technical” part is testing on a small batch and confirming the classifications make sense.

Is n8n free to use for this Drive invoice filing workflow?

Yes. n8n has a free self-hosted option and a free trial on n8n Cloud. Cloud plans start at $20/month for higher volume. You’ll also need to factor in Azure OpenAI usage costs, which depend on how much text you process.

Where can I host n8n to run this automation?

Two options: n8n Cloud (managed, easiest setup) or self-hosting on a VPS. For self-hosting, Hostinger VPS is affordable and handles n8n well. Self-hosting gives you unlimited executions but requires basic server management.

Can I customize this Drive invoice filing workflow for different categories?

Yes, and you should. You’ll update the prompt used by the Invoice Classifier Agent so it returns your categories (clients, cost centers, regions, or “paid vs. unpaid”). Then adjust the Route by Industry Switch to match those labels and point each route to the correct Google Drive folder. Some teams also add a “Needs review” route when the model is unsure, so nothing gets filed incorrectly.

Why is my Google Drive connection failing in this workflow?

Usually it’s expired OAuth access or missing Drive permissions. Reconnect the Google Drive credential in n8n, then confirm the account can see both the incoming folder and the destination folders. Also check that the workflow is using the right folder IDs, because a copied ID with one missing character will fail in a way that looks like “permissions.” If you’re processing a lot at once, Drive API limits can also cause intermittent failures, so try smaller batches first.

How many invoices can this Drive invoice filing automation handle?

On n8n Cloud Starter, you’re mainly limited by monthly executions and how you batch invoices. If you self-host, there’s no execution cap, so the limit becomes your server and API quotas. In practice, teams routinely process a few hundred invoices a week with this pattern, especially because Split in Batches keeps it from overwhelming Drive or the AI model.

Is this Drive invoice filing automation better than using Zapier or Make?

Often, yes. n8n is easier to scale for “process a folder of files” workflows because you can loop, branch, and handle batches without paying extra for every tiny step. It also gives you a self-host option, which matters when invoices are sensitive. Zapier or Make can still be fine for lightweight flows, but this one usually benefits from n8n’s control. Talk to an automation expert if you’re not sure which fits.

Once this is running, invoices stop piling up in the wrong places. Your folders stay usable, approvals move faster, and you don’t have to think about filing again.

Need Help Setting This Up?

Our automation experts can build and customize this workflow for your specific needs. Free 15-minute consultation—no commitment required.

Lisa Granqvist

Workflow Automation Expert

Expert in workflow automation and no-code tools.

×

Use template

Get instant access to this n8n workflow Json file

💬
Get a free quote today!
Get a free quote today!

Tell us what you need and we'll get back to you within one working day.

Get a free quote today!
Get a free quote today!

Tell us what you need and we'll get back to you within one working day.

Launch login modal Launch register modal