Automate Timesheet to Invoice Conversion with OpenAI, Gmail & Google Workspace — n8n 工作流
概览
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 from a Google Sheet
Organizes files in Client → Employee → Year folders
Reuses an existing invoice sheet or creates a new one and writes the invoice row
Quick Implementation Steps
Import the workflow JSON into your n8n instance.
Set
使用的节点
Google SheetsHTTP RequestGoogle DriveCodeOpenAI
工作流预览
⚡
G
Gmail Trigger
Split Binary Attachments
L
Loop: Process Each Attac…
Extract Timesheet Data (…
Get Customer Info From P…
S
Set Invoice Date & Due D…
G
Generate Sheet Name (Emp…
S
Set: Invoice Range
I
If: File Already Exists?
If: Invoice Range is 15…
S
Set: File Name from Star…
Merge: Combine Folder S…
Create New Sheet
Move Created Sheet to Fi…
Set: Row Data
Sheets: Append Row
Sheets: Final Append
Sheets: Create Sheet
Sheets: Append Row1
Extract Text from Attach…
Search: Client Invoices …
Search: Client Folder by…
Search: File By Start Da…
Search: File By End Date…
Drive: Move Sheet To Fin…
S
Set: Empty Row Structure
S
Set: Spreadsheet (ID & …
Append: Final Row to Exi…
C
Check if Year Folder Exi…
Create Client Name Folder
C
Check Client Name Folder
Search: Employee Name Fo…
C
Check Employee Name Folder
Create Employee Name Fol…
Search: Year Folder
Create Year Folder
Create Current Year Folder
S
Set Timesheet JSON Fields
HTTP Request(new sheet)
HTTP Request1(create she…
40 nodes46 edges
工作原理
- 1
触发器
工作流由 触发器 触发器启动。
- 2
处理
数据流经 40 个节点, connecting code, gmailtrigger, googledrive。
- 3
输出
工作流完成自动化并将结果发送到配置的目标。
节点详情 (40)
GO#1
Google Sheets
googleSheets
HT#2
HTTP Request
httpRequest
GO#3
Google Drive
googleDrive
CO#4
Code
code
OP#5
OpenAI
n8n-nodes-langchain.openAi
如何导入此工作流
- 1点击右侧 下载 JSON 按钮保存工作流文件。
- 2打开你的 n8n 实例,依次点击 工作流 → 新建 → 从文件导入。
- 3选择下载的
automate-timesheet-to-invoice-conversion-with-openai-gmail-google-workspace文件并点击导入。 - 4为每个服务节点配置 凭证(API 密钥、OAuth 等)。
- 5点击 测试工作流 验证一切正常,然后激活它。
或直接在 n8n → 从 JSON 导入 中粘贴:
{ "name": "Automate Timesheet to Invoice Conversion with OpenAI, Gmail & Google Workspace", "nodes": [...], ...}
集成
codegmailtriggergoogledrivegooglesheetshttprequestifmergeopenaisetsplitinbatches
创建者
DIGITAL BIZ TECH
@dbt
标签
codegmailtriggergoogledrivegooglesheetshttprequestifmergeopenaisetsplitinbatches