Extract invoice data from Gmail PDFs to Google Sheets with OpenAI and Slack
Ready for 3.0What this workflow does
This AI workflow has 8 nodes and runs on Gmail events. Along the way it connects Gmail, OpenAI Chat Model, Google Sheets and Slack.
How it runs
Trigger: On Gmail events.
- Extract Text from PDF (Extract from File): extracts data from a file (pdf)
- Extract Invoice Fields (Basic LLM Chain): sends a prompt to an LLM, with model: OpenAI Chat Model; output parser: Parse Invoice (JSON)
- Log to Bookkeeping Sheet (Google Sheets): append
- High-Value? (If): checks a condition and branches into true / false
- Send for Approval (Slack): post (message)
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
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) (New Invoice Email).
Nodes used (8)
- Gmail Trigger
n8n-nodes-base.gmailTrigger - Extract from File
n8n-nodes-base.extractFromFile - Basic LLM Chain
@n8n/n8n-nodes-langchain.chainLlm - OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi - Structured Output Parser
@n8n/n8n-nodes-langchain.outputParserStructured - Google Sheets
n8n-nodes-base.googleSheets - If
n8n-nodes-base.if - Slack
n8n-nodes-base.slack
From the author
Quick Overview This workflow monitors Gmail for emails with PDF attachments, extracts invoice fields with OpenAI, logs the results to a Google Sheets bookkeeping spreadsheet, and posts high-value invoices to Slack for approval. How it works 1. Triggers every…