Process and forecast AP invoices from Gmail with OpenAI and Google Sheets
Ready for 3.0What this workflow does
This AI workflow has 15 nodes and runs on Gmail events (plus 1 other trigger). Along the way it connects Gmail, OpenAI Chat Model and Google Sheets.
How it runs
Trigger: On Gmail events (plus 1 other trigger).
- Extract Text from PDF Invoice (Extract from File): extracts data from a file (pdf)
- Read All Invoices (Google Sheets): uses Google Sheets
- AI Extract & Categorize Invoice (Information Extractor): extracts structured fields from text with AI, with model: OpenAI GPT-5 Invoice Analysis
- Build Weekly Digest (Code): runs custom JavaScript code
- Prepare & Prioritize (Edit Fields (Set)): sets 12 fields: vendor, invoice_number, invoice_date…
- Email Weekly AP Digest (Gmail): uses Gmail
- Append Invoice to Google Sheets (Google Sheets): append
- Read Logged Invoices (Google Sheets): uses Google Sheets
- Calculate Cash Flow (Code): runs custom JavaScript code
- High-Value Invoice? (If): checks a condition and branches into true / false
…plus 2 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.
Nodes used (10)
- Gmail Trigger
n8n-nodes-base.gmailTrigger - Extract from File
n8n-nodes-base.extractFromFile - Information Extractor
@n8n/n8n-nodes-langchain.informationExtractor - OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi - Edit Fields (Set)
n8n-nodes-base.set - Google Sheets
n8n-nodes-base.googleSheets - Code
n8n-nodes-base.code - If
n8n-nodes-base.if - Gmail
n8n-nodes-base.gmail - Schedule Trigger
n8n-nodes-base.scheduleTrigger
From the author
Quick overview This workflow watches Gmail for unread invoice emails with PDF attachments, extracts invoice details with OpenAI, logs them to Google Sheets, calculates month-to-date and upcoming cash needs, and sends Gmail alerts for high-value invoices plus…