Extract data from PDF reports with Gmail, OCR, Google Sheets and OpenAI GPT-4.1-mini
Ready for 3.0What this workflow does
This AI workflow has 16 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.
- Workflow Configuration (Edit Fields (Set)): sets or maps fields
- Check PDF Attachment Exists (If): checks a condition and branches into true / false
- Extract Text from PDF (Extract from File): extracts data from a file
- Error Handler and Logger (Code): runs custom JavaScript code
- Parse Key Fields with AI (AI Agent): runs an AI agent, with model: OpenAI Chat Model; output parser: Structured Output Parser
- Normalize Extracted Data (Edit Fields (Set)): sets or maps fields
- Classify Document Type (Switch): routes items into branches
- Store Invoice Data (Google Sheets): uses Google Sheets
- Summarize Report with AI (AI Agent): runs an AI agent, with model: OpenAI Chat Model
- Notify Contract Team (Slack): uses Slack
…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.
- Still check Gmail Trigger below v1.4 runs as v1.4 (drafts skipped, max emails per poll) (New PDF Email Trigger).
Nodes used (11)
- Gmail Trigger
n8n-nodes-base.gmailTrigger - Edit Fields (Set)
n8n-nodes-base.set - If
n8n-nodes-base.if - Extract from File
n8n-nodes-base.extractFromFile - AI Agent
@n8n/n8n-nodes-langchain.agent - OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi - Structured Output Parser
@n8n/n8n-nodes-langchain.outputParserStructured - Switch
n8n-nodes-base.switch - Google Sheets
n8n-nodes-base.googleSheets - Slack
n8n-nodes-base.slack - Code
n8n-nodes-base.code
From the author
Who’s it for Consultants, agencies, financial analysts, and project managers who regularly receive client PDFs, invoices, or reports. How it works / What it does This n8n workflow automates PDF and report data extraction: 1. Triggers when a new PDF is…