Automate timesheet to invoice conversion with OpenAI, Gmail & Google Workspace
Ready for 3.0What this workflow does
This AI workflow has 40 nodes and runs on Gmail events. Along the way it connects Gmail, OpenAI, Google Sheets and Google Drive. It also calls universal-file-to-text-extractor.vercel.app over HTTP.
How it runs
Trigger: On Gmail events.
- Split Binary Attachments (Code): runs custom JavaScript code
- Loop: Process Each Attachment (Loop Over Items (Split in Batches)): loops over the items in batches
- Extract Text from Attachment (HTTP Request): calls universal-file-to-text-extractor.vercel.app (POST)
- Extract Timesheet Data (OpenAI) (OpenAI): uses OpenAI
- Set Timesheet JSON Fields (Edit Fields (Set)): sets 4 fields: Week Start Date, Week End Date, Client Name…
- Get Customer Info From PO Sheet (Google Sheets): uses Google Sheets
- Search: Client Invoices Folder (Google Drive): work with file folder
- Search: Client Folder by Name (Google Drive): work with file folder
- Check Client Name Folder (If): checks a condition and branches into true / false
- Search: Employee Name Folder (Google Drive): work with file folder
…plus 29 more steps. See the full node list below.
Services it uses
Other Google Sheets + Gmail templates (2,102) · Other OpenAI + Google Sheets templates (2,011) · Other OpenAI + Gmail templates (1,623)
HTTP calls to: universal-file-to-text-extractor.vercel.app
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) (Gmail Trigger).
- Code node: the task timeout drops from 300s to 60s. Test with a realistic data volume.
Nodes used (10)
- Gmail Trigger
n8n-nodes-base.gmailTrigger - Code
n8n-nodes-base.code - Loop Over Items (Split in Batches)
n8n-nodes-base.splitInBatches - OpenAI
@n8n/n8n-nodes-langchain.openAi - Google Sheets
n8n-nodes-base.googleSheets - Edit Fields (Set)
n8n-nodes-base.set - If
n8n-nodes-base.if - Merge
n8n-nodes-base.merge - Google Drive
n8n-nodes-base.googleDrive - HTTP Request
n8n-nodes-base.httpRequest
From the author
This workflow converts emailed timesheets into structured invoice rows in Google Sheets and stores them in the correct Google Drive folder structure. It: - Listens to Gmail for timesheet attachments - Runs OCR and AI parsing - Looks up Customer and PO data…