Automate invoice processing with GPT-4o classification and XML export to accounting
Needs changesWhat this workflow does
This AI workflow has 18 nodes and runs on Google Drive events (file created) (plus 1 other trigger). Along the way it connects Google Drive, OpenAI Chat Model, Gmail and Slack and 1 more.
How it runs
Trigger: On Google Drive events (file created) (plus 1 other trigger).
- Merge: merges the data from its input branches
- Filter: keeps only the items that match a condition
- Download Invoice PDF (Google Drive): download
- Extract PDF Text (Extract from File): extracts data from a file (pdf)
- Parse Invoice Data (Code): runs custom JavaScript code
- AI Invoice Classifier (AI Agent): runs an AI agent, with model: OpenAI Chat Model
- Parse AI Classification (Code): runs custom JavaScript code
- Convert to XML (XML): converts between XML and JSON
- Format XML Output (Edit Fields (Set)): sets 3 fields: xmlContent, fileName, invoiceData
- Needs Approval? (If): checks a condition and branches into true / false
…plus 5 more steps. See the full node list below.
Services it uses
Other Google Sheets + Gmail templates (2,102) · Other OpenAI + Google Sheets templates (2,011) · Other OpenAI + Gmail templates (1,623)
Before you upgrade to n8n 3.0
1 thing in this workflow is removed in n8n 3.0. Fix it before you upgrade:
- AI Agent v1 (old agent modes) in AI Invoice Classifier (v1.7): replace with Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent.
Rather not rewrite it? Many of these flows can be rebuilt in Make (free plan).
Published 2025 — 19% of 2025 templates need changes for 3.0. See how template age affects 3.0 readiness →
| Removed in 3.0 | Replace with |
|---|---|
| AI Agent v1 (old agent modes) AI Invoice Classifier (v1.7) | Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent. |
Nodes used (16)
- Google Drive Trigger
n8n-nodes-base.googleDriveTrigger - Webhook
n8n-nodes-base.webhook - Merge
n8n-nodes-base.merge - Filter
n8n-nodes-base.filter - Google Drive
n8n-nodes-base.googleDrive - Extract from File
n8n-nodes-base.extractFromFile - Code
n8n-nodes-base.code - OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi - AI Agent
@n8n/n8n-nodes-langchain.agent - XML
n8n-nodes-base.xml - Edit Fields (Set)
n8n-nodes-base.set - If
n8n-nodes-base.if - Gmail
n8n-nodes-base.gmail - Slack
n8n-nodes-base.slack - Google Sheets
n8n-nodes-base.googleSheets - Respond to Webhook
n8n-nodes-base.respondToWebhook
From the author
Intelligent Invoice Processing with AI Classification and XML Export Summary Automated invoice processing pipeline that extracts data from PDF invoices, uses AI Agent for intelligent expense categorization, generates XML for accounting systems, and routes…