Extracción de datos de facturas con OCR, Gemini AI y Airtable
Este es unAI Summarization, Multimodal AIflujo de automatización del dominio deautomatización que contiene 18 nodos.Utiliza principalmente nodos como If, Switch, Telegram, Aggregate, AirtableTool. Extraer datos de facturas con OCR, Gemini AI y Airtable
- •Bot Token de Telegram
- •Clave de API de Airtable
- •Clave de API de Google Gemini
Nodos utilizados (18)
Categoría
{
"meta": {
"instanceId": "558d88703fb65b2d0e44613bc35916258b0f0bf983c5d4730c00c424b77ca36a",
"templateCredsSetupCompleted": true
},
"nodes": [
{
"id": "b7d49dfb-9e34-4ef3-8533-938a5dc1bbcb",
"name": "Local File Trigger",
"type": "n8n-nodes-base.localFileTrigger",
"position": [
-2928,
368
],
"parameters": {
"path": "/image-output/ocr",
"events": [
"add"
],
"options": {
"usePolling": true,
"awaitWriteFinish": true
},
"triggerOn": "folder"
},
"typeVersion": 1
},
{
"id": "dda2ddaa-ff24-4694-95c8-5e3d5cfaa88d",
"name": "Modelo de chat Google Gemini",
"type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
"position": [
-1488,
592
],
"parameters": {
"options": {},
"modelName": "models/gemini-2.5-flash-preview-05-20"
},
"credentials": {
"googlePalmApi": {
"id": "DgSd8qj0VSc8QXnp",
"name": "Google Gemini(PaLM) Api account (vinrocks.1789)"
}
},
"typeVersion": 1
},
{
"id": "9c13f6b8-626a-4eb0-80ff-90b093d1948d",
"name": "Tesseract",
"type": "n8n-nodes-tesseractjs.tesseractNode",
"position": [
-2224,
464
],
"parameters": {
"options": {
"psm": "SINGLE_COLUMN",
"language": "eng"
}
},
"typeVersion": 1
},
{
"id": "a364c562-5092-4c88-8a80-2271997dee0d",
"name": "Interruptor",
"type": "n8n-nodes-base.switch",
"position": [
-1984,
368
],
"parameters": {
"rules": {
"values": [
{
"outputKey": "Jpg",
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "6e77c197-5184-4293-9038-e4231c481df9",
"operator": {
"type": "string",
"operation": "contains"
},
"leftValue": "={{ $('Check File Type').item.json.fileExtension }}",
"rightValue": "jpg"
}
]
},
"renameOutput": true
},
{
"outputKey": "Pdf",
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "d500e707-0f7e-4a4f-86a6-9090888dbf7e",
"operator": {
"name": "filter.operator.equals",
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $('Check File Type').item.json.fileExtension }}",
"rightValue": "pdf"
}
]
},
"renameOutput": true
},
{
"outputKey": "Png",
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "5411d519-2475-43fd-ae62-8d9f795716c8",
"operator": {
"name": "filter.operator.equals",
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $('Check File Type').item.json.fileExtension }}",
"rightValue": "png"
}
]
},
"renameOutput": true
}
]
},
"options": {
"allMatchingOutputs": false
}
},
"typeVersion": 3.2
},
{
"id": "13144779-2c29-47bd-bf46-5d58b272564c",
"name": "Agregar",
"type": "n8n-nodes-base.aggregate",
"position": [
-1728,
368
],
"parameters": {
"include": "allFieldsExcept",
"options": {},
"aggregate": "aggregateAllItemData",
"fieldsToExclude": "confidence, filename, totalPages, pages, metadata, info"
},
"typeVersion": 1
},
{
"id": "f264557e-3691-4c64-97a9-5ca11cf58789",
"name": "PDF Page Extract",
"type": "n8n-nodes-pdf-page-extract.pdfPageExtract",
"position": [
-2224,
224
],
"parameters": {
"includeRawText": true
},
"typeVersion": 1
},
{
"id": "4ce9888a-1534-41eb-9636-87b861e7ea79",
"name": "Telegram",
"type": "n8n-nodes-base.telegram",
"position": [
-1120,
368
],
"webhookId": "bb7bb12e-438f-4cd1-82bd-a7ffcc08b33e",
"parameters": {
"text": "={{ $json.output }}",
"chatId": "8182583xxx",
"additionalFields": {
"appendAttribution": false
}
},
"credentials": {
"telegramApi": {
"id": "o62WcUBZY5nNl0wr",
"name": "Telegram account"
}
},
"typeVersion": 1.2
},
{
"id": "cab3796a-87ed-4a33-9eb6-f73f5da840cc",
"name": "Read File",
"type": "n8n-nodes-base.readWriteFile",
"position": [
-2656,
368
],
"parameters": {
"options": {
"dataPropertyName": "data"
},
"fileSelector": "={{ $json.path }}"
},
"typeVersion": 1
},
{
"id": "3bd4eb3b-c0d6-48bc-ac75-a10eaf258f39",
"name": "Nota adhesiva",
"type": "n8n-nodes-base.stickyNote",
"position": [
-3008,
240
],
"parameters": {
"color": 7,
"width": 260,
"height": 100,
"content": "### Ensure you are pointing the folder location in the trigger to the folder you have mounted in n8n."
},
"typeVersion": 1
},
{
"id": "40d2b4ef-4cea-4cdd-aec2-92293c50c11f",
"name": "Nota adhesiva1",
"type": "n8n-nodes-base.stickyNote",
"position": [
-3008,
-80
],
"parameters": {
"width": 800,
"height": 180,
"content": "## Features\n- ✅ Supports JPG, PNG, and PDF invoices\n- 🧠 Extracts: Invoice number, date, total, tax, subtotal, currency, vendor name, email, phone, ship-to address\n- 📤 Sends data to Airtable automatically\n- 📬 Telegram message on completion (optional)\n- 🔁 Runs automatically when files are dropped into a folder"
},
"typeVersion": 1
},
{
"id": "55ef424c-137c-4dee-82f8-0cec6ec9b6dc",
"name": "Nota adhesiva2",
"type": "n8n-nodes-base.stickyNote",
"position": [
-2288,
128
],
"parameters": {
"color": 7,
"width": 220,
"height": 80,
"content": "### Community node:\nn8n-nodes-pdf-page-extract"
},
"typeVersion": 1
},
{
"id": "b3b4dc66-549e-4a07-a59f-75dad99ff605",
"name": "Nota adhesiva3",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1184,
240
],
"parameters": {
"color": 7,
"height": 100,
"content": "### Please ensure to update your Chat ID so that the bot can send the message your DM."
},
"typeVersion": 1
},
{
"id": "c93ffea4-940a-4249-9f82-fc3e4971f18f",
"name": "Nota adhesiva4",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1232,
624
],
"parameters": {
"color": 3,
"width": 360,
"height": 80,
"content": "### If you would not like to use Airtable, you can use Google sheets as an alternative."
},
"typeVersion": 1
},
{
"id": "1471c100-5ab0-4eb7-bd0b-2c4063f71715",
"name": "Nota adhesiva5",
"type": "n8n-nodes-base.stickyNote",
"position": [
-2288,
624
],
"parameters": {
"color": 3,
"width": 200,
"height": 80,
"content": "### Community node:\nn8n-nodes-tesseractjs"
},
"typeVersion": 1
},
{
"id": "8b019576-37ff-4c16-b679-fb00d132243f",
"name": "Nota adhesiva6",
"type": "n8n-nodes-base.stickyNote",
"position": [
-3008,
768
],
"parameters": {
"width": 740,
"height": 80,
"content": "## If you need any help in setting up with the workflow, please feel free to contact me @ vinaysingh.b@outlook.in"
},
"typeVersion": 1
},
{
"id": "28d2c502-3104-4d18-ab1c-2fd14495a3cf",
"name": "Extract Invoice Data (Gemini)",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
-1488,
368
],
"parameters": {
"text": "={{ $json.data }}",
"options": {
"systemMessage": "=<TASK>\nProcess received \"{{ $json.data[0].text }}\" and update individual fields in the Airtable tool, like for example\n\nInvoice Number,\nInvoice date if available (if available), Always convert the date into format : '2025-06-21',\nInvoice SubTotal amount (if available),\nInvoice tax (if available),\nInvoice Total,\nCurrency,\nVendor Name,\nEmail address of the vendor,\nPhone number(ignore if FAX number is available),\nShip to address\n</TASK>\n\n<Telegram_Response>\nPlease reply in the below format:\n\nInvoice details has been updated successfully.\nInvoice: <>\nInvoice date: <>\nInvoice SubTotal: <>\nInvoice tax: <>\nInvoice Total: <>\nCurrency: <>\nVendor: <>\nEmail address: <>\nPhone number: <>\nShip to address: <>\n</Telegram_Response>"
},
"promptType": "define"
},
"typeVersion": 2
},
{
"id": "d702cf55-1761-4b31-9e8e-e8ceb1da9171",
"name": "Check File Type",
"type": "n8n-nodes-base.if",
"position": [
-2480,
368
],
"parameters": {
"options": {
"ignoreCase": true
},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": false,
"typeValidation": "strict"
},
"combinator": "or",
"conditions": [
{
"id": "7fbe81a0-6a37-4e9b-af8a-b692a8151507",
"operator": {
"type": "string",
"operation": "contains"
},
"leftValue": "={{ $json.fileType }}",
"rightValue": "pdf"
}
]
}
},
"typeVersion": 2.2
},
{
"id": "880b0f62-07e1-495e-b36a-948c5eb70c27",
"name": "Save to Airtable",
"type": "n8n-nodes-base.airtableTool",
"position": [
-1344,
592
],
"parameters": {
"base": {
"__rl": true,
"mode": "list",
"value": "appAl4CX1mypNyRJv",
"cachedResultUrl": "https://airtable.com/appAl4CX1mypNyRJv",
"cachedResultName": "Personal Project Tracker"
},
"table": {
"__rl": true,
"mode": "list",
"value": "tblBr2vL7frtavGn8",
"cachedResultUrl": "https://airtable.com/appAl4CX1mypNyRJv/tblBr2vL7frtavGn8",
"cachedResultName": "OCR"
},
"columns": {
"value": {
"Currency": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Currency', ``, 'string') }}",
"Invoice tax": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Invoice_tax', ``, 'number') }}",
"Vendor name": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Vendor_name', ``, 'string') }}",
"Invoice date": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Invoice_date', ``, 'string') }}",
"Phone number": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Phone_number', ``, 'string') }}",
"Email address": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Email_address', ``, 'string') }}",
"Invoice Total": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Invoice_Total', ``, 'number') }}",
"Invoice Number": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Invoice_Number', ``, 'string') }}",
"Ship to address": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Ship_to_address', ``, 'string') }}",
"Invoice SubTotal": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Invoice_SubTotal', ``, 'number') }}"
},
"schema": [
{
"id": "Invoice Number",
"type": "string",
"display": true,
"removed": false,
"readOnly": false,
"required": false,
"displayName": "Invoice Number",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Invoice date",
"type": "string",
"display": true,
"removed": false,
"readOnly": false,
"required": false,
"displayName": "Invoice date",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Invoice SubTotal",
"type": "number",
"display": true,
"removed": false,
"readOnly": false,
"required": false,
"displayName": "Invoice SubTotal",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Invoice tax",
"type": "number",
"display": true,
"removed": false,
"readOnly": false,
"required": false,
"displayName": "Invoice tax",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Invoice Total",
"type": "number",
"display": true,
"removed": false,
"readOnly": false,
"required": false,
"displayName": "Invoice Total",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Currency",
"type": "string",
"display": true,
"removed": false,
"readOnly": false,
"required": false,
"displayName": "Currency",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Vendor name",
"type": "string",
"display": true,
"removed": false,
"readOnly": false,
"required": false,
"displayName": "Vendor name",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Email address",
"type": "string",
"display": true,
"removed": false,
"readOnly": false,
"required": false,
"displayName": "Email address",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Phone number",
"type": "string",
"display": true,
"removed": false,
"readOnly": false,
"required": false,
"displayName": "Phone number",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Ship to address",
"type": "string",
"display": true,
"removed": false,
"readOnly": false,
"required": false,
"displayName": "Ship to address",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "create"
},
"credentials": {
"airtableTokenApi": {
"id": "9jCNxhVQFJQuxhGU",
"name": "Airtable Personal Access Token account"
}
},
"typeVersion": 2.1
}
],
"pinData": {},
"connections": {
"Switch": {
"main": [
[
{
"node": "Aggregate",
"type": "main",
"index": 0
}
],
[
{
"node": "Aggregate",
"type": "main",
"index": 0
}
],
[
{
"node": "Aggregate",
"type": "main",
"index": 0
}
]
]
},
"Aggregate": {
"main": [
[
{
"node": "28d2c502-3104-4d18-ab1c-2fd14495a3cf",
"type": "main",
"index": 0
}
]
]
},
"cab3796a-87ed-4a33-9eb6-f73f5da840cc": {
"main": [
[
{
"node": "d702cf55-1761-4b31-9e8e-e8ceb1da9171",
"type": "main",
"index": 0
}
]
]
},
"9c13f6b8-626a-4eb0-80ff-90b093d1948d": {
"main": [
[
{
"node": "Switch",
"type": "main",
"index": 0
}
]
]
},
"d702cf55-1761-4b31-9e8e-e8ceb1da9171": {
"main": [
[
{
"node": "f264557e-3691-4c64-97a9-5ca11cf58789",
"type": "main",
"index": 0
}
],
[
{
"node": "9c13f6b8-626a-4eb0-80ff-90b093d1948d",
"type": "main",
"index": 0
}
]
]
},
"f264557e-3691-4c64-97a9-5ca11cf58789": {
"main": [
[
{
"node": "Switch",
"type": "main",
"index": 0
}
]
]
},
"880b0f62-07e1-495e-b36a-948c5eb70c27": {
"ai_tool": [
[
{
"node": "28d2c502-3104-4d18-ab1c-2fd14495a3cf",
"type": "ai_tool",
"index": 0
}
]
]
},
"b7d49dfb-9e34-4ef3-8533-938a5dc1bbcb": {
"main": [
[
{
"node": "cab3796a-87ed-4a33-9eb6-f73f5da840cc",
"type": "main",
"index": 0
}
]
]
},
"Google Gemini Chat Model": {
"ai_languageModel": [
[
{
"node": "28d2c502-3104-4d18-ab1c-2fd14495a3cf",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"28d2c502-3104-4d18-ab1c-2fd14495a3cf": {
"main": [
[
{
"node": "4ce9888a-1534-41eb-9636-87b861e7ea79",
"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?
Avanzado - Resumen de IA, IA Multimodal
¿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
Vinay
@doctorCompartir este flujo de trabajo