Process invoices and send weekly AI reports with OpenAI and Gmail
Ready for 3.0What this workflow does
This AI workflow has 19 nodes and runs when someone submits an n8n form (“Invoice Upload - AI Processing System”) (plus 1 other trigger). Along the way it connects Gmail and OpenAI Chat Model.
How it runs
Trigger: When someone submits an n8n form (“Invoice Upload - AI Processing System”) (plus 1 other trigger).
- Workflow Configuration (Edit Fields (Set)): sets 2 fields: reportRecipientEmail, validCurrencies
- Fetch Weekly Invoices (Data table): get
- Store Raw Form Submission (Data table): uses Data table
- Generate Weekly Report (AI Agent): runs an AI agent, with model: OpenAI GPT-5-mini Model for Reports
- Extract Invoice Content (Extract from File): extracts data from a file (pdf)
- Send Weekly Report Email (Gmail): uses Gmail
- Extract Invoice Data with AI (AI Agent): runs an AI agent, with model: OpenAI GPT-5-mini Model; output parser: Invoice Data Schema Parser
- Validate Invoice Data (Code): runs custom JavaScript code
- Check Validation Result (If): checks a condition and branches into true / false
- Prepare Success Email Data (Edit Fields (Set)): sets 2 fields: emailSubject, emailBody
…plus 4 more steps. See the full node list below.
Services it uses
Other OpenAI + Gmail templates (1,623)
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.
Nodes used (11)
- n8n Form Trigger
n8n-nodes-base.formTrigger - Edit Fields (Set)
n8n-nodes-base.set - Data table
n8n-nodes-base.dataTable - Extract from File
n8n-nodes-base.extractFromFile - AI Agent
@n8n/n8n-nodes-langchain.agent - Structured Output Parser
@n8n/n8n-nodes-langchain.outputParserStructured - Code
n8n-nodes-base.code - If
n8n-nodes-base.if - Gmail
n8n-nodes-base.gmail - Schedule Trigger
n8n-nodes-base.scheduleTrigger - OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi
From the author
Overview This workflow automates invoice handling from upload to reporting using AI. Users submit invoices through a simple form. The workflow extracts key details, validates the data, stores valid invoices, and sends email notifications. It also generates a…