Validate invoice tax compliance from Gmail using Groq, Notion, and Google Sheets
Ready for 3.0What this workflow does
This AI workflow has 17 nodes and runs on Gmail events. Along the way it connects Groq Chat Model, Gmail, Notion and Google Sheets and 2 more.
How it runs
Trigger: On Gmail events.
- Fetch Email Attachments (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
- Fetch Tax Rules (Notion): get many (database page)
- Format AI Output (Edit Fields (Set)): sets 11 fields: invoice_number, po_number, grn_number…
- Lookup PO Details (Google Sheets): uses Google Sheets
- Consolidate Validation Data (Merge): merges the data from its input branches
- Compliance Engine (Code): runs custom JavaScript code
- Log Audit Entry (Notion): work with database page
- Check Compliance Status (If): checks a condition and branches into true / false
…plus 4 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) (Monitor Inbox).
Nodes used (14)
- Basic LLM Chain
@n8n/n8n-nodes-langchain.chainLlm - Structured Output Parser
@n8n/n8n-nodes-langchain.outputParserStructured - Groq Chat Model
@n8n/n8n-nodes-langchain.lmChatGroq - Code
n8n-nodes-base.code - Gmail Trigger
n8n-nodes-base.gmailTrigger - Gmail
n8n-nodes-base.gmail - Extract from File
n8n-nodes-base.extractFromFile - Notion
n8n-nodes-base.notion - Google Sheets
n8n-nodes-base.googleSheets - Edit Fields (Set)
n8n-nodes-base.set - Merge
n8n-nodes-base.merge - If
n8n-nodes-base.if - Slack
n8n-nodes-base.slack - Google Drive
n8n-nodes-base.googleDrive
From the author
Quick overview This workflow monitors a Gmail inbox for PDF invoices, uses Groq (Llama 3.3) to extract structured invoice fields, validates the invoice against Purchase Orders in Google Sheets and tax rules in Notion, logs an audit entry to Notion, and…