Extraer datos de facturas de Google Drive a Sheets usando Dumpling AI
Este es unAI, IT Opsflujo de automatización del dominio deautomatización que contiene 8 nodos.Utiliza principalmente nodos como Code, SplitOut, GoogleDrive, HttpRequest, GoogleSheets, combinando tecnología de inteligencia artificial para lograr automatización inteligente. Usar Dumpling AI para extraer datos de facturas de Google Drive y guardarlas en Sheets
- •Credenciales de API de Google Drive
- •Pueden requerirse credenciales de autenticación para la API de destino
- •Credenciales de API de Google Sheets
Nodos utilizados (8)
{
"id": "Q9K6tDu4TJpqtRQ1",
"meta": {
"instanceId": "a1ae5c8dc6c65e674f9c3947d083abcc749ef2546dff9f4ff01de4d6a36ebfe6",
"templateCredsSetupCompleted": true
},
"name": "Extract and Save Invoice Data from Google Drive to Sheets with Dumpling AI",
"tags": [],
"nodes": [
{
"id": "4cdec8f8-9e08-433f-832d-18a9af3f4531",
"name": "Google Drive Trigger – Watch Folder for New Files",
"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": "Descargar Archivo de Factura",
"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": "Convertir Archivo de Factura a Base64",
"type": "n8n-nodes-base.extractFromFile",
"position": [
280,
-180
],
"parameters": {
"options": {},
"operation": "binaryToPropery"
},
"typeVersion": 1
},
{
"id": "760f6b02-65b6-4a28-af70-53602f8e2724",
"name": "Enviar Archivo a Dumpling AI para Extracción de Datos",
"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": "Analizar Respuesta JSON de Dumpling AI",
"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": "Dividir Elementos line de la Factura",
"type": "n8n-nodes-base.splitOut",
"position": [
940,
-180
],
"parameters": {
"options": {},
"fieldToSplitOut": "items"
},
"typeVersion": 1
},
{
"id": "834d6b99-cd0e-4633-949d-40e53ba06324",
"name": "Guardar Datos en 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": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
-740,
-400
],
"parameters": {
"width": 540,
"height": 500,
"content": "### 📌 **Workflow Overview: Extract & Save Invoice Data from Google Drive with Dumpling AI**\n\n#### This workflow monitors a Google Drive folder for new files (invoices), extracts structured invoice data using Dumpling AI, and appends it to a Google Sheet.\n---\n🔹 **Node Breakdown:**\n\n1. **Google Drive Trigger** – Watches a folder for new invoice files. \n2. **Download Invoice File** – Retrieves the uploaded file from Drive. \n3. **Extract Base64** – Converts the downloaded file to base64 format. \n4. **Dumpling AI Extraction** – Sends the base64 file with a prompt to Dumpling AI for invoice parsing. \n5. **Parse AI Response** – Converts the returned JSON string into readable structured data. \n6. **Split Line Items** – Breaks the `items` array into individual invoice entries. \n7. **Append to Google Sheet** – Saves the invoice data row by row into the target spreadsheet.\n\n✅ Make sure you have your Dumpling AI API key and correct Google Sheet ID in place before running the workflow.\n\n"
},
"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": {
"b67aea52-5f39-4fce-b476-d3b991b30519": {
"main": [
[
{
"node": "94ccaf02-0070-4200-b778-139ea075949a",
"type": "main",
"index": 0
}
]
]
},
"84318159-a0ce-4049-a7db-2ac0fa79b8d4": {
"main": [
[
{
"node": "834d6b99-cd0e-4633-949d-40e53ba06324",
"type": "main",
"index": 0
}
]
]
},
"94ccaf02-0070-4200-b778-139ea075949a": {
"main": [
[
{
"node": "760f6b02-65b6-4a28-af70-53602f8e2724",
"type": "main",
"index": 0
}
]
]
},
"b5545cf6-8ebb-4c0e-903b-5a14af7de087": {
"main": [
[
{
"node": "84318159-a0ce-4049-a7db-2ac0fa79b8d4",
"type": "main",
"index": 0
}
]
]
},
"760f6b02-65b6-4a28-af70-53602f8e2724": {
"main": [
[
{
"node": "b5545cf6-8ebb-4c0e-903b-5a14af7de087",
"type": "main",
"index": 0
}
]
]
},
"4cdec8f8-9e08-433f-832d-18a9af3f4531": {
"main": [
[
{
"node": "b67aea52-5f39-4fce-b476-d3b991b30519",
"type": "main",
"index": 0
}
]
]
}
}
}¿Cómo usar este flujo de trabajo?
Copie el código de configuración JSON de arriba, cree un nuevo flujo de trabajo en su instancia de n8n y seleccione "Importar desde JSON", pegue la configuración y luego modifique la configuración de credenciales según sea necesario.
¿En qué escenarios es adecuado este flujo de trabajo?
Intermedio - Inteligencia Artificial, Operaciones de TI
¿Es de pago?
Este flujo de trabajo es completamente gratuito, puede importarlo y usarlo directamente. Sin embargo, tenga en cuenta que los servicios de terceros utilizados en el flujo de trabajo (como la API de OpenAI) pueden requerir un pago por su cuenta.
Flujos de trabajo relacionados recomendados
Yang
@yangCompartir este flujo de trabajo