使用Dumpling AI从Google Drive提取发票数据至Sheets
中级
这是一个AI, IT Ops领域的自动化工作流,包含 8 个节点。主要使用 Code, SplitOut, GoogleDrive, HttpRequest, GoogleSheets 等节点,结合人工智能技术实现智能自动化。 使用Dumpling AI从Google Drive提取发票数据并保存至Sheets
前置要求
- •Google Drive API 凭证
- •可能需要目标 API 的认证凭证
- •Google Sheets API 凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
"id": "Q9K6tDu4TJpqtRQ1",
"meta": {
"instanceId": "a1ae5c8dc6c65e674f9c3947d083abcc749ef2546dff9f4ff01de4d6a36ebfe6",
"templateCredsSetupCompleted": true
},
"name": "使用 Dumpling AI 从 Google Drive 提取并保存发票数据到 Sheets",
"tags": [],
"nodes": [
{
"id": "4cdec8f8-9e08-433f-832d-18a9af3f4531",
"name": "Google Drive 触发器 – 监视文件夹中的新文件",
"type": "n8n-nodes-base.googleDriveTrigger",
"position": [
-160,
-180
],
"parameters": {
"event": "fileCreated",
"options": {},
"pollTimes": {
"item": [
{
"mode": "everyMinute"
}
]
},
"triggerOn": "specificFolder",
"folderToWatch": {
"__rl": true,
"mode": "list",
"value": "",
"cachedResultUrl": "https://drive.google.com/drive/folders/1Dquh3PguyBImKvHlbkp55NBvYoB8IKr5",
"cachedResultName": "invoice-n8n"
}
},
"credentials": {
"googleDriveOAuth2Api": {
"id": "8JSukfcGbpywgEUz",
"name": "n8n"
}
},
"typeVersion": 1
},
{
"id": "b67aea52-5f39-4fce-b476-d3b991b30519",
"name": "下载发票文件",
"type": "n8n-nodes-base.googleDrive",
"position": [
60,
-180
],
"parameters": {
"fileId": {
"__rl": true,
"mode": "id",
"value": "={{ $json.id }}"
},
"options": {},
"operation": "download"
},
"credentials": {
"googleDriveOAuth2Api": {
"id": "8JSukfcGbpywgEUz",
"name": "n8n"
}
},
"typeVersion": 3
},
{
"id": "94ccaf02-0070-4200-b778-139ea075949a",
"name": "将发票文件转换为 Base64",
"type": "n8n-nodes-base.extractFromFile",
"position": [
280,
-180
],
"parameters": {
"options": {},
"operation": "binaryToPropery"
},
"typeVersion": 1
},
{
"id": "760f6b02-65b6-4a28-af70-53602f8e2724",
"name": "发送文件到 Dumpling AI 进行数据提取",
"type": "n8n-nodes-base.httpRequest",
"position": [
500,
-180
],
"parameters": {
"url": "https://app.dumplingai.com/api/v1/extract-document",
"method": "POST",
"options": {},
"jsonBody": "={\n \"inputMethod\": \"base64\",\n \"files\": [\"{{ $json.data }}\"], \n \"prompt\": \"Extract the order number, document date, PO number, sold to name and address, ship to name and address, list of items with model, quantity, unit price, and total price, and the final total amount including tax.\", \n \"jsonMode\": \"true\"\n}",
"sendBody": true,
"specifyBody": "json",
"authentication": "genericCredentialType",
"genericAuthType": "httpHeaderAuth"
},
"credentials": {
"httpHeaderAuth": {
"id": "xamyMqCpAech5BeT",
"name": "Header Auth account"
}
},
"typeVersion": 4.2
},
{
"id": "b5545cf6-8ebb-4c0e-903b-5a14af7de087",
"name": "解析 Dumpling AI JSON 响应",
"type": "n8n-nodes-base.code",
"position": [
720,
-180
],
"parameters": {
"jsCode": "const raw = $input.first().json.results;\nconst parsed = JSON.parse(raw);\nreturn [{ json: parsed }];\n"
},
"typeVersion": 2
},
{
"id": "84318159-a0ce-4049-a7db-2ac0fa79b8d4",
"name": "从发票中拆分行项目",
"type": "n8n-nodes-base.splitOut",
"position": [
940,
-180
],
"parameters": {
"options": {},
"fieldToSplitOut": "items"
},
"typeVersion": 1
},
{
"id": "834d6b99-cd0e-4633-949d-40e53ba06324",
"name": "保存数据到 Google Sheet",
"type": "n8n-nodes-base.googleSheets",
"position": [
1140,
-180
],
"parameters": {
"columns": {
"value": {
"Model": "={{ $json.model }}",
"Quantity": "={{ $json.quantity }}",
"Po_number": "={{ $('Parse Dumpling AI JSON Response').item.json.PO_number }}",
"Description": "={{ $json.description }}",
"Total price": "={{ $json.total_price }}",
"Unity price": "={{ $json.unit_price }}",
"Order number": "={{ $('Parse Dumpling AI JSON Response').item.json.order_number }}",
"Ship to name": "={{ $('Parse Dumpling AI JSON Response').item.json.ship_to_name }}",
"Sold to name": "={{ $('Parse Dumpling AI JSON Response').item.json.sold_to_name }}",
"Document Date": "={{ $('Parse Dumpling AI JSON Response').item.json.document_date }}",
"Ship to address": "={{ $('Parse Dumpling AI JSON Response').item.json.ship_to_address }}",
"Sold to address": "={{ $('Parse Dumpling AI JSON Response').item.json.sold_to_address }}"
},
"schema": [
{
"id": "Order number",
"type": "string",
"display": true,
"required": false,
"displayName": "Order number",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Document Date",
"type": "string",
"display": true,
"required": false,
"displayName": "Document Date",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Po_number",
"type": "string",
"display": true,
"required": false,
"displayName": "Po_number",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Sold to name",
"type": "string",
"display": true,
"required": false,
"displayName": "Sold to name",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Sold to address",
"type": "string",
"display": true,
"required": false,
"displayName": "Sold to address",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Ship to name",
"type": "string",
"display": true,
"required": false,
"displayName": "Ship to name",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Ship to address",
"type": "string",
"display": true,
"required": false,
"displayName": "Ship to address",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Model",
"type": "string",
"display": true,
"required": false,
"displayName": "Model",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Description",
"type": "string",
"display": true,
"required": false,
"displayName": "Description",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Quantity",
"type": "string",
"display": true,
"required": false,
"displayName": "Quantity",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Unity price",
"type": "string",
"display": true,
"required": false,
"displayName": "Unity price",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Total price",
"type": "string",
"display": true,
"required": false,
"displayName": "Total price",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "append",
"sheetName": {
"__rl": true,
"mode": "list",
"value": "",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/170eyZdmRUNXlpSZmcl5PiHTUKjukd-soDQq2cAe6FQo/edit#gid=0",
"cachedResultName": "Sheet1"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/170eyZdmRUNXlpSZmcl5PiHTUKjukd-soDQq2cAe6FQo/edit?usp=drivesdk",
"cachedResultName": "my invoice"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "GaJqJHuS5mQxap7q",
"name": "Google Sheets account"
}
},
"typeVersion": 4.5
},
{
"id": "f98684d0-6c7b-4ba2-b820-4b30e9ff10c1",
"name": "便签",
"type": "n8n-nodes-base.stickyNote",
"position": [
-740,
-400
],
"parameters": {
"width": 540,
"height": 500,
"content": "### 📌 **工作流概览:使用 Dumpling AI 从 Google Drive 提取并保存发票数据**"
},
"typeVersion": 1
}
],
"active": false,
"pinData": {
"Split line Items from Invoice": [
{
"json": {
"model": "AMST42CU1300",
"quantity": 1,
"unit_price": "$773.85",
"description": "AIR HANDLER",
"total_price": "$773.85"
}
},
{
"json": {
"model": "GLZS4BA4210",
"quantity": 1,
"unit_price": "$1,508.85",
"description": "14.3 SEER2 HP R32, 3.5 TON",
"total_price": "$1,508.85"
}
},
{
"json": {
"model": "HKTSD15XB",
"quantity": 1,
"unit_price": "$156.00",
"description": "ELECTRIC HEAT KIT, 15 KW",
"total_price": "$156.00"
}
},
{
"json": {
"model": "83615",
"quantity": 1,
"unit_price": "$15.39",
"description": "MARS 60A NON-FUSED DISCONNECT",
"total_price": "$15.39"
}
},
{
"json": {
"model": "6RSR048118",
"quantity": 1,
"unit_price": "$11.22",
"description": "INSULTUBE TITAN 1/2\"X1-1/8\"X 6'",
"total_price": "$11.22"
}
},
{
"json": {
"model": "SB-2",
"quantity": 1,
"unit_price": "$0.67",
"description": "2\" SEALANT BRUSH",
"total_price": "$0.67"
}
},
{
"json": {
"model": "6RX048078",
"quantity": 2,
"unit_price": "$3.18",
"total_price": "$6.36"
}
},
{
"json": {
"model": "CADS-1G",
"quantity": 1,
"unit_price": "$14.36",
"description": "FIBER DUCT SEALANT GRAY 1 GAL",
"total_price": "$14.36"
}
},
{
"json": {
"model": "599390-EC",
"quantity": 1,
"unit_price": "$63.91",
"description": "20X20 1-2\" F/C FILTER BASE",
"total_price": "$63.91"
}
},
{
"json": {
"model": "CCF-8-2020-1",
"quantity": 1,
"unit_price": "$4.09",
"description": "CC M8 PLEAT FILTER 20X20X1",
"total_price": "$4.09"
}
},
{
"json": {
"model": "TH1110DH1003",
"quantity": 1,
"unit_price": "$38.21",
"description": "PRO1000 1H/1C NON-PROG HORIZON",
"total_price": "$38.21"
}
},
{
"json": {
"model": "401-007BC",
"quantity": 1,
"unit_price": "$0.62",
"description": "PVC 3/4 TEE SLIP",
"total_price": "$0.62"
}
},
{
"json": {
"model": "436-007BC",
"quantity": 2,
"unit_price": "$0.49",
"description": "PVC 3/4 MALE ADPT MIPTXS",
"total_price": "$0.98"
}
},
{
"json": {
"model": "406-007BC",
"quantity": 2,
"unit_price": "$0.46",
"description": "PVC 3/4 90 ELB SXS",
"total_price": "$0.92"
}
},
{
"json": {
"model": "429-007BC",
"quantity": 3,
"unit_price": "$0.45",
"description": "PVC 3/4 COUP SLIP",
"total_price": "$1.34"
}
},
{
"json": {
"model": "97085",
"quantity": 1,
"unit_price": "$33.31",
"description": "SAFE-T-SWITCH SS1-GEN3",
"total_price": "$33.31"
}
},
{
"json": {
"model": "304100-HC",
"quantity": 1,
"unit_price": "$31.84",
"description": "MASTIC TAPE 3\" X 100'",
"total_price": "$31.84"
}
},
{
"json": {
"model": "84137",
"quantity": 1,
"unit_price": "$25.78",
"description": "WHIP 3/4 X 6' 8GA NONMETALLIC",
"total_price": "$25.78"
}
}
],
"Parse Dumpling AI JSON Response": [
{
"json": {
"tax": "$221.74",
"items": [
{
"model": "AMST42CU1300",
"quantity": 1,
"unit_price": "$773.85",
"description": "AIR HANDLER",
"total_price": "$773.85"
},
{
"model": "GLZS4BA4210",
"quantity": 1,
"unit_price": "$1,508.85",
"description": "14.3 SEER2 HP R32, 3.5 TON",
"total_price": "$1,508.85"
},
{
"model": "HKTSD15XB",
"quantity": 1,
"unit_price": "$156.00",
"description": "ELECTRIC HEAT KIT, 15 KW",
"total_price": "$156.00"
},
{
"model": "83615",
"quantity": 1,
"unit_price": "$15.39",
"description": "MARS 60A NON-FUSED DISCONNECT",
"total_price": "$15.39"
},
{
"model": "6RSR048118",
"quantity": 1,
"unit_price": "$11.22",
"description": "INSULTUBE TITAN 1/2\"X1-1/8\"X 6'",
"total_price": "$11.22"
},
{
"model": "SB-2",
"quantity": 1,
"unit_price": "$0.67",
"description": "2\" SEALANT BRUSH",
"total_price": "$0.67"
},
{
"model": "6RX048078",
"quantity": 2,
"unit_price": "$3.18",
"total_price": "$6.36"
},
{
"model": "CADS-1G",
"quantity": 1,
"unit_price": "$14.36",
"description": "FIBER DUCT SEALANT GRAY 1 GAL",
"total_price": "$14.36"
},
{
"model": "599390-EC",
"quantity": 1,
"unit_price": "$63.91",
"description": "20X20 1-2\" F/C FILTER BASE",
"total_price": "$63.91"
},
{
"model": "CCF-8-2020-1",
"quantity": 1,
"unit_price": "$4.09",
"description": "CC M8 PLEAT FILTER 20X20X1",
"total_price": "$4.09"
},
{
"model": "TH1110DH1003",
"quantity": 1,
"unit_price": "$38.21",
"description": "PRO1000 1H/1C NON-PROG HORIZON",
"total_price": "$38.21"
},
{
"model": "401-007BC",
"quantity": 1,
"unit_price": "$0.62",
"description": "PVC 3/4 TEE SLIP",
"total_price": "$0.62"
},
{
"model": "436-007BC",
"quantity": 2,
"unit_price": "$0.49",
"description": "PVC 3/4 MALE ADPT MIPTXS",
"total_price": "$0.98"
},
{
"model": "406-007BC",
"quantity": 2,
"unit_price": "$0.46",
"description": "PVC 3/4 90 ELB SXS",
"total_price": "$0.92"
},
{
"model": "429-007BC",
"quantity": 3,
"unit_price": "$0.45",
"description": "PVC 3/4 COUP SLIP",
"total_price": "$1.34"
},
{
"model": "97085",
"quantity": 1,
"unit_price": "$33.31",
"description": "SAFE-T-SWITCH SS1-GEN3",
"total_price": "$33.31"
},
{
"model": "304100-HC",
"quantity": 1,
"unit_price": "$31.84",
"description": "MASTIC TAPE 3\" X 100'",
"total_price": "$31.84"
},
{
"model": "84137",
"quantity": 1,
"unit_price": "$25.78",
"description": "WHIP 3/4 X 6' 8GA NONMETALLIC",
"total_price": "$25.78"
}
],
"PO_number": "ASHLEY OAK",
"order_number": "FN29709",
"ship_to_name": "CARNES & SONS LLC",
"sold_to_name": "CARNES & SONS LLC",
"total_amount": "$2,909.44",
"document_date": "08/23/2024",
"ship_to_address": "DAIKIN COMFORT TECHNOLOGY #364, 4980 EISENHAUER RD, SUITE 206 SAN ANTONIO TX 78218",
"sold_to_address": "9988 MACAWAY RD, ADKINS TX 78101"
}
}
],
"Send file to Dumpling AI for Data Extraction": [
{
"json": {
"pages": 4,
"prompt": "Extract the order number, document date, PO number, sold to name and address, ship to name and address, list of items with model, quantity, unit price, and total price, and the final total amount including tax.",
"results": "{\n \"order_number\": \"FN29709\",\n \"document_date\": \"08/23/2024\",\n \"PO_number\": \"ASHLEY OAK\",\n \"sold_to_name\": \"CARNES & SONS LLC\",\n \"sold_to_address\": \"9988 MACAWAY RD, ADKINS TX 78101\",\n \"ship_to_name\": \"CARNES & SONS LLC\",\n \"ship_to_address\": \"DAIKIN COMFORT TECHNOLOGY #364, 4980 EISENHAUER RD, SUITE 206 SAN ANTONIO TX 78218\",\n \"items\": [\n {\n \"model\": \"AMST42CU1300\",\n \"description\": \"AIR HANDLER\",\n \"quantity\": 1,\n \"unit_price\": \"$773.85\",\n \"total_price\": \"$773.85\"\n },\n {\n \"model\": \"GLZS4BA4210\",\n \"description\": \"14.3 SEER2 HP R32, 3.5 TON\",\n \"quantity\": 1,\n \"unit_price\": \"$1,508.85\",\n \"total_price\": \"$1,508.85\"\n },\n {\n \"model\": \"HKTSD15XB\",\n \"description\": \"ELECTRIC HEAT KIT, 15 KW\",\n \"quantity\": 1,\n \"unit_price\": \"$156.00\",\n \"total_price\": \"$156.00\"\n },\n {\n \"model\": \"83615\",\n \"description\": \"MARS 60A NON-FUSED DISCONNECT\",\n \"quantity\": 1,\n \"unit_price\": \"$15.39\",\n \"total_price\": \"$15.39\"\n },\n {\n \"model\": \"6RSR048118\",\n \"description\": \"INSULTUBE TITAN 1/2\\\"X1-1/8\\\"X 6'\",\n \"quantity\": 1,\n \"unit_price\": \"$11.22\",\n \"total_price\": \"$11.22\"\n },\n {\n \"model\": \"SB-2\",\n \"description\": \"2\\\" SEALANT BRUSH\",\n \"quantity\": 1,\n \"unit_price\": \"$0.67\",\n \"total_price\": \"$0.67\"\n },\n {\n \"model\": \"6RX048078\",\n \"quantity\": 2,\n \"unit_price\": \"$3.18\",\n \"total_price\": \"$6.36\"\n },\n {\n \"model\": \"CADS-1G\",\n \"description\": \"FIBER DUCT SEALANT GRAY 1 GAL\",\n \"quantity\": 1,\n \"unit_price\": \"$14.36\",\n \"total_price\": \"$14.36\"\n },\n {\n \"model\": \"599390-EC\",\n \"description\": \"20X20 1-2\\\" F/C FILTER BASE\",\n \"quantity\": 1,\n \"unit_price\": \"$63.91\",\n \"total_price\": \"$63.91\"\n },\n {\n \"model\": \"CCF-8-2020-1\",\n \"description\": \"CC M8 PLEAT FILTER 20X20X1\",\n \"quantity\": 1,\n \"unit_price\": \"$4.09\",\n \"total_price\": \"$4.09\"\n },\n {\n \"model\": \"TH1110DH1003\",\n \"description\": \"PRO1000 1H/1C NON-PROG HORIZON\",\n \"quantity\": 1,\n \"unit_price\": \"$38.21\",\n \"total_price\": \"$38.21\"\n },\n {\n \"model\": \"401-007BC\",\n \"description\": \"PVC 3/4 TEE SLIP\",\n \"quantity\": 1,\n \"unit_price\": \"$0.62\",\n \"total_price\": \"$0.62\"\n },\n {\n \"model\": \"436-007BC\",\n \"description\": \"PVC 3/4 MALE ADPT MIPTXS\",\n \"quantity\": 2,\n \"unit_price\": \"$0.49\",\n \"total_price\": \"$0.98\"\n },\n {\n \"model\": \"406-007BC\",\n \"description\": \"PVC 3/4 90 ELB SXS\",\n \"quantity\": 2,\n \"unit_price\": \"$0.46\",\n \"total_price\": \"$0.92\"\n },\n {\n \"model\": \"429-007BC\",\n \"description\": \"PVC 3/4 COUP SLIP\",\n \"quantity\": 3,\n \"unit_price\": \"$0.45\",\n \"total_price\": \"$1.34\"\n },\n {\n \"model\": \"97085\",\n \"description\": \"SAFE-T-SWITCH SS1-GEN3\",\n \"quantity\": 1,\n \"unit_price\": \"$33.31\",\n \"total_price\": \"$33.31\"\n },\n {\n \"model\": \"304100-HC\",\n \"description\": \"MASTIC TAPE 3\\\" X 100'\",\n \"quantity\": 1,\n \"unit_price\": \"$31.84\",\n \"total_price\": \"$31.84\"\n },\n {\n \"model\": \"84137\",\n \"description\": \"WHIP 3/4 X 6' 8GA NONMETALLIC\",\n \"quantity\": 1,\n \"unit_price\": \"$25.78\",\n \"total_price\": \"$25.78\"\n }\n ],\n \"total_amount\": \"$2,909.44\",\n \"tax\": \"$221.74\"\n}",
"fileCount": 1,
"creditUsage": 14
}
}
]
},
"settings": {
"executionOrder": "v1"
},
"versionId": "d618bc19-f2a6-454b-bbce-9833eca14022",
"connections": {
"Download Invoice File": {
"main": [
[
{
"node": "Convert invoice File to Base64",
"type": "main",
"index": 0
}
]
]
},
"Split line Items from Invoice": {
"main": [
[
{
"node": "Save Data to Google Sheet",
"type": "main",
"index": 0
}
]
]
},
"Convert invoice File to Base64": {
"main": [
[
{
"node": "Send file to Dumpling AI for Data Extraction",
"type": "main",
"index": 0
}
]
]
},
"Parse Dumpling AI JSON Response": {
"main": [
[
{
"node": "Split line Items from Invoice",
"type": "main",
"index": 0
}
]
]
},
"Send file to Dumpling AI for Data Extraction": {
"main": [
[
{
"node": "Parse Dumpling AI JSON Response",
"type": "main",
"index": 0
}
]
]
},
"Google Drive Trigger – Watch Folder for New Files": {
"main": [
[
{
"node": "Download Invoice File",
"type": "main",
"index": 0
}
]
]
}
}
}常见问题
如何使用这个工作流?
复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。
这个工作流适合什么场景?
中级 - 人工智能, IT 运维
需要付费吗?
本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。
相关工作流推荐
使用Dumpling AI + GPT-4o从视频洞察自动生成Facebook帖子
使用Dumpling AI + GPT-4o从视频洞察自动生成Facebook帖子
Google Drive
Http Request
Google Sheets
+4
8 节点Yang
人工智能
通过 Dumpling AI 抓取 Google Places 并自动保存到 Google Sheets
通过 Dumpling AI 抓取 Google Places 并自动保存到 Google Sheets
Split Out
Http Request
Google Sheets
+2
6 节点Yang
人工智能
将上传的视频转化为AI生成的博客研究(使用Dumpling AI和ChatGPT)
视频转博客研究自动化,使用GPT-4o、Dumpling AI和Google Sheets
Code
Google Drive
Http Request
+5
9 节点Yang
内容创作
宠物店 4
🐶 宠物店预约 AI 代理
If
Set
Code
+41
187 节点Bruno Dias
人工智能
AI新闻简报构建器:使用Dumpling AI抓取网站,GPT-4o摘要
AI新闻简报构建器:Dumpling AI抓取网站,GPT-4o摘要
Set
Code
Gmail
+6
10 节点Yang
人工智能
AI驱动的RAG文档处理与聊天机器人 - Google Drive、Supabase、OpenAI
基于Google Drive、Supabase和OpenAI的AI驱动RAG文档处理与聊天机器人
Set
Code
Limit
+19
35 节点Billy Christi
人工智能