Validate invoice readiness with Gmail, Google Sheets and Groq/OpenAI
Ready for 3.0Ready for 3.0. This template uses no nodes that n8n 3.0 removes. No removed nodes, versions or helpers found. Static check, last run 2026-10-19.
What this workflow does
This AI workflow has 23 nodes and runs on Gmail events. Along the way it connects Gmail, Google Sheets and Groq Chat Model.
How it runs
Trigger: On Gmail events.
- Download Email Data (Gmail): get
- Read PDF Content (Extract from File): extracts data from a file (pdf)
- AI Extract Invoice (Basic LLM Chain): sends a prompt to an LLM, with model: LLM; output parser: Invoice Field Schema
- Clean Extracted Fields (Edit Fields (Set)): sets 10 fields: invoice_number, po_number, grn_number…
- Search ERP for PO (Google Sheets): uses Google Sheets
- Join Invoice & ERP Data (Merge): merges the data from its input branches
- Check if PO Exists (If): checks a condition and branches into true / false
- Run Data Integrity Checks (Code): runs custom JavaScript code
- Notify Supplier: PO Not Found (Gmail): uses Gmail
- Check Validation Success (If): checks a condition and branches into true / false
…plus 8 more steps. See the full node list below.
Services it uses
Before you upgrade to n8n 3.0
Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.
- Still check Gmail Trigger below v1.4 runs as v1.4 (drafts skipped, max emails per poll) (Watch New Invoices).
Nodes used (11)
- Code
n8n-nodes-base.code - If
n8n-nodes-base.if - Basic LLM Chain
@n8n/n8n-nodes-langchain.chainLlm - Gmail
n8n-nodes-base.gmail - Google Sheets
n8n-nodes-base.googleSheets - Gmail Trigger
n8n-nodes-base.gmailTrigger - Extract from File
n8n-nodes-base.extractFromFile - Edit Fields (Set)
n8n-nodes-base.set - Merge
n8n-nodes-base.merge - Structured Output Parser
@n8n/n8n-nodes-langchain.outputParserStructured - Groq Chat Model
@n8n/n8n-nodes-langchain.lmChatGroq
From the author
Quick overview This workflow monitors Gmail for invoice emails, extracts structured fields from attached PDFs using Groq LLMs, validates invoices against Purchase Orders stored in Google Sheets, predicts rejection risk with an LLM, emails suppliers about…