报销申请
这是一个Invoice Processing, Multimodal AI领域的自动化工作流,包含 19 个节点。主要使用 If, Code, Gmail, Merge, FormTrigger 等节点。 使用 Gmail、Google Drive 和 AI 验证实现员工报销工作流自动化
- •Google 账号和 Gmail API 凭证
- •Google Drive API 凭证
- •Google Sheets API 凭证
- •OpenAI API Key
{
"id": "oxgrJNmYucFmtqbU",
"meta": {
"instanceId": "87616dfce72ffd690a51f4d408ac3b27a946f12a1119e0e281f5ed271497219e",
"templateCredsSetupCompleted": true
},
"name": "报销申请",
"tags": [],
"nodes": [
{
"id": "62704744-327d-4ba6-9c50-27aabe2fbca5",
"name": "表单提交时",
"type": "n8n-nodes-base.formTrigger",
"position": [
-1060,
-920
],
"webhookId": "bdaaa5da-76c9-4faa-a469-561b21b7cc4b",
"parameters": {
"options": {
"buttonLabel": "Submit",
"appendAttribution": false,
"respondWithOptions": {
"values": {
"formSubmittedText": "=Thank you !\nYou will receive an email shortly about your reimbursement request from Finance Department.\n"
}
}
},
"formTitle": "Reimbursement Form",
"formFields": {
"values": [
{
"fieldLabel": "Emp Name",
"placeholder": "Employee Name",
"requiredField": true
},
{
"fieldLabel": "Emp ID",
"placeholder": "Employee ID",
"requiredField": true
},
{
"fieldType": "email",
"fieldLabel": "Email",
"placeholder": "Email Address",
"requiredField": true
},
{
"fieldType": "number",
"fieldLabel": "Claim Amount",
"placeholder": "INR 0.00",
"requiredField": true
},
{
"fieldType": "dropdown",
"fieldLabel": "Nature of Bill",
"fieldOptions": {
"values": [
{
"option": "Food"
},
{
"option": "Travel"
},
{
"option": "Accomodation"
},
{
"option": "Others"
}
]
},
"requiredField": true
},
{
"fieldType": "file",
"fieldLabel": "Upload Bills",
"requiredField": true,
"acceptFileTypes": ".jpg, .png, .pdf"
}
]
},
"responseMode": "lastNode",
"formDescription": "Reimbursement Form"
},
"typeVersion": 2.2
},
{
"id": "03b7edb5-2f55-48a4-9fbb-9c230f45df70",
"name": "合并",
"type": "n8n-nodes-base.merge",
"position": [
-420,
-940
],
"parameters": {
"mode": "chooseBranch",
"useDataOfInput": 2
},
"typeVersion": 3.2
},
{
"id": "6393835a-0680-482d-86eb-fd9703a562ff",
"name": "如果账单存在",
"type": "n8n-nodes-base.if",
"position": [
-660,
-1080
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "b07ac5ff-eb0d-4d85-b15f-60eba9384546",
"operator": {
"name": "filter.operator.equals",
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.name }}",
"rightValue": "={{ $('On form submission').item.json['Upload Bills'][0].filename }}"
}
]
}
},
"typeVersion": 2.2
},
{
"id": "548f0d70-643c-4ef5-861a-5ad584a40321",
"name": "下载现有账单",
"type": "n8n-nodes-base.googleDrive",
"position": [
-280,
-1100
],
"parameters": {
"fileId": {
"__rl": true,
"mode": "id",
"value": "={{ $json.id }}"
},
"options": {},
"operation": "download"
},
"credentials": {
"googleDriveOAuth2Api": {
"id": "xFTXDFHVEmRlrR5e",
"name": "Google Drive account 2"
}
},
"typeVersion": 3
},
{
"id": "0127a1b4-5a2e-42a6-b2bc-7476dd7bf817",
"name": "邮件通知无效申请",
"type": "n8n-nodes-base.gmail",
"position": [
720,
-1180
],
"webhookId": "6e325205-b968-4dc0-a796-c0ebc41dd2fc",
"parameters": {
"sendTo": "={{ $('On form submission').item.json.Email }}",
"message": "=Dear {{ $json.receiptContent.empName }},\n\nIt was identified that the claims requested does not match the total bill from the uploaded receipts . \n\nAmount Claimed: $ {{ $json.receiptContent.amountClaimed }}/-\nTotal Bill: $ {{ $json.receiptContent.totalBill }}/-\nUploaded Recipt: {{ $json.receiptContent.uploadedFile }}\nBill Type: {{ $json.receiptContent.billType }}\n\nPlease review and resubmit the request.\n\n*Claims are Subject to Approvals*\n\nRegards,\nFinance Depeartment\n\n",
"options": {
"ccList": "prath002@gmail.com",
"appendAttribution": false
},
"subject": "=New Reimbursement Request - INR {{ $('On form submission').item.json['Claim Amount'] }} /-",
"emailType": "text"
},
"credentials": {
"gmailOAuth2": {
"id": "qRfscNFGDLVMQs6g",
"name": "Gmail account"
}
},
"typeVersion": 2.1
},
{
"id": "13253bbd-890a-49b2-a89e-821575f298dc",
"name": "邮件通知有效申请",
"type": "n8n-nodes-base.gmail",
"position": [
880,
-980
],
"webhookId": "6e325205-b968-4dc0-a796-c0ebc41dd2fc",
"parameters": {
"sendTo": "={{ $('On form submission').item.json.Email }}",
"message": "=Dear {{ $json['Employee Name'] }},\n\nThank you for your email. \n\nRequest ID: {{ $json.RequestID }}\n\nYou reimbursement rquest as below is being reviewed.\n\nAmount Claimed: ${{ $('Validate False Claims').item.json.receiptContent.amountClaimed }}/-\nTotal Bill: ${{ $json['Total Billed Amount'] }}/-\nUploaded Recipt: {{ $json['Recieipt Link'] }}\nBill Type: {{ $json['Receipt Type'] }}\n\n*Claims are subject to approvals*\n\nRegards,\nFinance Depeartment\n",
"options": {
"ccList": "prath002@gmail.com",
"appendAttribution": false
},
"subject": "=New Reimbursement Request - INR {{ $('On form submission').item.json['Claim Amount'] }} /- | {{ $json.RequestID }}",
"emailType": "text"
},
"credentials": {
"gmailOAuth2": {
"id": "qRfscNFGDLVMQs6g",
"name": "Gmail account"
}
},
"typeVersion": 2.1
},
{
"id": "ca855f2a-c40e-4dec-845c-8b7b0d81b330",
"name": "合并输入",
"type": "@n8n/n8n-nodes-langchain.openAi",
"position": [
100,
-1100
],
"parameters": {
"text": "=Create a JSON as below and just return structed JSON in strings. \n\n{\n empID: {{ $('On form submission').item.json['Emp ID'] }},\n empName: {{ $('On form submission').item.json['Emp Name'] }},\n empEmail: {{ $('On form submission').item.json.Email }},\n billType: {{ $('On form submission').item.json['Nature of Bill'] }},\n amountClaimed: {{ $('On form submission').item.json['Claim Amount'] || 0.00}},\n totalBill: Extract the total amount from the binary,\n uploadedFile: {{ $json.webViewLink }}\n\n## NOTE\n - Do not append ```json\\n in the output",
"modelId": {
"__rl": true,
"mode": "list",
"value": "gpt-4o-mini",
"cachedResultName": "GPT-4O-MINI"
},
"options": {},
"resource": "image",
"inputType": "base64",
"operation": "analyze"
},
"credentials": {
"openAiApi": {
"id": "qlhg6EzexBZ9bwXO",
"name": "OpenAi account"
}
},
"typeVersion": 1.8
},
{
"id": "de6eb222-2e33-4277-8cfb-45042e6902e3",
"name": "验证虚假申请",
"type": "n8n-nodes-base.code",
"position": [
260,
-1100
],
"parameters": {
"jsCode": "var jsonObj = JSON.parse($input.first().json.content)\n\nif (jsonObj.amountClaimed != jsonObj.totalBill) {\n return {isFalseClaim: true, receiptContent: jsonObj,requestID: generateRandomString()}\n} else return {isFalseClaim: false, receiptContent: jsonObj, requestID: generateRandomString()}\n\n\nfunction generateRandomString(length = 20) {\n const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n let result = jsonObj.empID+'_';\n for (let i = 0; i < length; i++) {\n result += chars.charAt(Math.floor(Math.random() * chars.length));\n }\n return result;\n}\n"
},
"typeVersion": 2
},
{
"id": "34b61b4d-a314-4d3d-9e9a-806c5a747ce4",
"name": "上传_账单",
"type": "n8n-nodes-base.googleDrive",
"position": [
-260,
-940
],
"parameters": {
"name": "={{ $json['Upload Bills'][0].filename }}",
"driveId": {
"__rl": true,
"mode": "list",
"value": "My Drive"
},
"options": {},
"folderId": {
"__rl": true,
"mode": "list",
"value": "1huBmHtSlSU2nV5xbRDDOaBY-CKIPmnjs",
"cachedResultUrl": "https://drive.google.com/drive/folders/1huBmHtSlSU2nV5xbRDDOaBY-CKIPmnjs",
"cachedResultName": "Reimburse Bills"
},
"inputDataFieldName": "=Upload_Bills"
},
"credentials": {
"googleDriveOAuth2Api": {
"id": "xFTXDFHVEmRlrR5e",
"name": "Google Drive account 2"
}
},
"typeVersion": 3
},
{
"id": "bf47788d-8326-4524-b0e4-58cfc453da72",
"name": "下载_账单",
"type": "n8n-nodes-base.googleDrive",
"position": [
-100,
-940
],
"parameters": {
"fileId": {
"__rl": true,
"mode": "id",
"value": "={{ $json.id }}"
},
"options": {},
"operation": "download"
},
"credentials": {
"googleDriveOAuth2Api": {
"id": "xFTXDFHVEmRlrR5e",
"name": "Google Drive account 2"
}
},
"typeVersion": 3
},
{
"id": "b9ae6568-76dd-4605-8402-765a25e850ed",
"name": "搜索_账单",
"type": "n8n-nodes-base.googleDrive",
"onError": "continueRegularOutput",
"position": [
-840,
-1080
],
"parameters": {
"limit": 5,
"filter": {
"folderId": {
"__rl": true,
"mode": "list",
"value": "1huBmHtSlSU2nV5xbRDDOaBY-CKIPmnjs",
"cachedResultUrl": "https://drive.google.com/drive/folders/1huBmHtSlSU2nV5xbRDDOaBY-CKIPmnjs",
"cachedResultName": "Reimburse Bills"
}
},
"options": {
"fields": [
"id",
"name",
"webViewLink"
]
},
"resource": "fileFolder",
"queryString": "={{ $json['Upload Bills'][0].filename }}"
},
"credentials": {
"googleDriveOAuth2Api": {
"id": "xFTXDFHVEmRlrR5e",
"name": "Google Drive account 2"
}
},
"typeVersion": 3,
"alwaysOutputData": true
},
{
"id": "b9a932ea-9404-453d-b45d-1ced96120d57",
"name": "如果",
"type": "n8n-nodes-base.if",
"position": [
420,
-1100
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "9d358347-9a20-425a-b6ef-4f03007c99fd",
"operator": {
"type": "boolean",
"operation": "true",
"singleValue": true
},
"leftValue": "={{ $json.isFalseClaim }}",
"rightValue": ""
}
]
}
},
"typeVersion": 2.2
},
{
"id": "7182bbde-016f-4ff0-abb9-43dcf82f9bf2",
"name": "添加请求",
"type": "n8n-nodes-base.googleSheets",
"position": [
720,
-980
],
"parameters": {
"columns": {
"value": {
"Bill Date": "={{ $now }}",
"RequestID": "={{ $json.requestID }}",
"Employee ID": "={{ $('Validate False Claims').item.json.receiptContent.empID }}",
"Is_Approved": "No",
"Uploaded On": "={{ $now }}",
"Receipt Type": "={{ $('Validate False Claims').item.json.receiptContent.billType }}",
"Employee Name": "={{ $('Validate False Claims').item.json.receiptContent.empName }}",
"Recieipt Link": "={{ $('Validate False Claims').item.json.receiptContent.uploadedFile }}",
"Total Billed Amount": "={{ $('Validate False Claims').item.json.receiptContent.totalBill }}"
},
"schema": [
{
"id": "RequestID",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "RequestID",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Employee ID",
"type": "string",
"display": true,
"required": false,
"displayName": "Employee ID",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Employee Name",
"type": "string",
"display": true,
"required": false,
"displayName": "Employee Name",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Receipt Type",
"type": "string",
"display": true,
"required": false,
"displayName": "Receipt Type",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Total Billed Amount",
"type": "string",
"display": true,
"required": false,
"displayName": "Total Billed Amount",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Bill Date",
"type": "string",
"display": true,
"required": false,
"displayName": "Bill Date",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Uploaded On",
"type": "string",
"display": true,
"required": false,
"displayName": "Uploaded On",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Recieipt Link",
"type": "string",
"display": true,
"required": false,
"displayName": "Recieipt Link",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Is_Approved",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Is_Approved",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "append",
"sheetName": {
"__rl": true,
"mode": "list",
"value": "gid=0",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1ttZJOK5L-_zFTSRUoOyNkJ9VL60mgd6HRTvaQWKvYAs/edit#gid=0",
"cachedResultName": "Sheet1"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1ttZJOK5L-_zFTSRUoOyNkJ9VL60mgd6HRTvaQWKvYAs",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1ttZJOK5L-_zFTSRUoOyNkJ9VL60mgd6HRTvaQWKvYAs/edit?usp=drivesdk",
"cachedResultName": "Receipts"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "tFyqtoZjnmHw7ZN5",
"name": "Google Sheets account"
}
},
"typeVersion": 4.6
},
{
"id": "64793a3d-e3d1-462a-8870-4af280f81423",
"name": "便签",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1300,
-1000
],
"parameters": {
"color": 4,
"width": 380,
"height": 220,
"content": "## 提交表单"
},
"typeVersion": 1
},
{
"id": "cb6b5988-9eb9-4686-9f5b-3a2ce92179d9",
"name": "便签1",
"type": "n8n-nodes-base.stickyNote",
"position": [
-880,
-1260
],
"parameters": {
"width": 360,
"height": 340,
"content": "## 验证用户上传的账单。"
},
"typeVersion": 1
},
{
"id": "b1501bda-4ad4-45a0-9b95-322d307b3688",
"name": "便签2",
"type": "n8n-nodes-base.stickyNote",
"position": [
-480,
-1180
],
"parameters": {
"color": 5,
"width": 520,
"height": 560,
"content": "## 上传和下载"
},
"typeVersion": 1
},
{
"id": "46d1de94-b727-450e-adc2-10e424f39291",
"name": "便签3",
"type": "n8n-nodes-base.stickyNote",
"position": [
60,
-1300
],
"parameters": {
"width": 500,
"height": 360,
"content": "## 提取、验证"
},
"typeVersion": 1
},
{
"id": "45aa008a-5f9f-41ed-b7ba-0473edf9a597",
"name": "便签4",
"type": "n8n-nodes-base.stickyNote",
"position": [
680,
-1240
],
"parameters": {
"color": 3,
"width": 280,
"height": 220,
"content": "## 无效申请"
},
"typeVersion": 1
},
{
"id": "5391e33a-7b73-43d6-9a13-444ccf6840e8",
"name": "便签5",
"type": "n8n-nodes-base.stickyNote",
"position": [
680,
-1000
],
"parameters": {
"color": 4,
"width": 380,
"height": 300,
"content": ""
},
"typeVersion": 1
}
],
"active": false,
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"versionId": "94c7c211-e7bf-45ec-b0c9-8f31bf7b7229",
"connections": {
"If": {
"main": [
[
{
"node": "Mail Invalid Claim",
"type": "main",
"index": 0
}
],
[
{
"node": "Add Request",
"type": "main",
"index": 0
}
]
]
},
"Merge": {
"main": [
[
{
"node": "Upload_Bills",
"type": "main",
"index": 0
}
]
]
},
"Add Request": {
"main": [
[
{
"node": "Mail Valid Claim",
"type": "main",
"index": 0
}
]
]
},
"MergeInputs": {
"main": [
[
{
"node": "Validate False Claims",
"type": "main",
"index": 0
}
]
]
},
"Search_Bill": {
"main": [
[
{
"node": "if Bill Exists",
"type": "main",
"index": 0
}
]
]
},
"Upload_Bills": {
"main": [
[
{
"node": "Download_Bills",
"type": "main",
"index": 0
}
]
]
},
"Download_Bills": {
"main": [
[
{
"node": "MergeInputs",
"type": "main",
"index": 0
}
]
]
},
"if Bill Exists": {
"main": [
[
{
"node": "Download Existing Bill",
"type": "main",
"index": 0
}
],
[
{
"node": "Merge",
"type": "main",
"index": 0
}
]
]
},
"Mail Valid Claim": {
"main": [
[]
]
},
"On form submission": {
"main": [
[
{
"node": "Search_Bill",
"type": "main",
"index": 0
},
{
"node": "Merge",
"type": "main",
"index": 1
}
]
]
},
"Validate False Claims": {
"main": [
[
{
"node": "If",
"type": "main",
"index": 0
}
]
]
},
"Download Existing Bill": {
"main": [
[
{
"node": "MergeInputs",
"type": "main",
"index": 0
}
]
]
}
}
}如何使用这个工作流?
复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。
这个工作流适合什么场景?
高级 - 发票处理, 多模态 AI
需要付费吗?
本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。
相关工作流推荐
Pramod Kumar Rathoure
@prathoureDesign and build custom n8n workflows that: ⚡ Eliminate repetitive work 📊 Integrate tools like Google Workspace, CRMs, and APIs ✅ Deliver faster, error-free results I create solutions that save time, boost accuracy, and let teams focus on high-value work. For me, automation isn’t just about technology—it’s about freeing people from busywork so they can do what matters most. let’s talk—I can help you turn them into smooth, automated workflows.
分享此工作流