Automatic email invoice archiving & data extraction with Gmail, Drive & AI
Ready for 3.0What this workflow does
This AI workflow has 17 nodes and runs on a schedule (every hour). Along the way it connects Google Sheets, Google Drive, Gmail and OpenRouter Chat Model.
How it runs
Trigger: On a schedule (every hour).
- Get many messages (Gmail): get many
- Filter: keeps only the items that match a condition
- Check: Message already processed (Google Sheets): uses Google Sheets
- If: checks a condition and branches into true / false
- Gmail: get
- Google Drive: uses Google Drive
- downloadFile (HTTP Request): calls an HTTP API
- Extract from File: extracts data from a file (pdf)
- Code: runs custom JavaScript code
- AI Agent: runs an AI agent, with model: OpenRouter Chat Model
…plus 5 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 (12)
- AI Agent
@n8n/n8n-nodes-langchain.agent - Code
n8n-nodes-base.code - Google Sheets
n8n-nodes-base.googleSheets - HTTP Request
n8n-nodes-base.httpRequest - Google Drive
n8n-nodes-base.googleDrive - Gmail
n8n-nodes-base.gmail - Schedule Trigger
n8n-nodes-base.scheduleTrigger - Extract from File
n8n-nodes-base.extractFromFile - OpenRouter Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenRouter - Filter
n8n-nodes-base.filter - If
n8n-nodes-base.if - FTP
n8n-nodes-base.ftp
From the author
Quick overview Automatically collect invoice PDFs from Gmail, archive them in Google Drive or an optional FTP/SFTP server, extract structured invoice data with AI, and record the results in Google Sheets. How it works 1. Scheduled inbox check — A Schedule…