This workflow corresponds to n8n.io template #7634 — we link there as the canonical source.
This workflow follows the Agent → Airtabletool recipe pattern — see all workflows that pair these two integrations.
The workflow JSON
Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →
{
"meta": {
"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": "Google Gemini Chat Model",
"type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
"position": [
-1488,
592
],
"parameters": {
"options": {},
"modelName": "models/gemini-2.5-flash-preview-05-20"
},
"credentials": {
"googlePalmApi": {
"name": "<your credential>"
}
},
"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": "Switch",
"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": "Aggregate",
"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
],
"parameters": {
"text": "={{ $json.output }}",
"chatId": "8182583xxx",
"additionalFields": {
"appendAttribution": false
}
},
"credentials": {
"telegramApi": {
"name": "<your credential>"
}
},
"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": "Sticky Note",
"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": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"position": [
-3008,
-80
],
"parameters": {
"width": 800,
"height": 180,
"content": "## Features\n- \u2705 Supports JPG, PNG, and PDF invoices\n- \ud83e\udde0 Extracts: Invoice number, date, total, tax, subtotal, currency, vendor name, email, phone, ship-to address\n- \ud83d\udce4 Sends data to Airtable automatically\n- \ud83d\udcec Telegram message on completion (optional)\n- \ud83d\udd01 Runs automatically when files are dropped into a folder"
},
"typeVersion": 1
},
{
"id": "55ef424c-137c-4dee-82f8-0cec6ec9b6dc",
"name": "Sticky Note2",
"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": "Sticky Note3",
"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": "Sticky Note4",
"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": "Sticky Note5",
"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": "Sticky Note6",
"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": {
"name": "<your credential>"
}
},
"typeVersion": 2.1
}
],
"connections": {
"Switch": {
"main": [
[
{
"node": "Aggregate",
"type": "main",
"index": 0
}
],
[
{
"node": "Aggregate",
"type": "main",
"index": 0
}
],
[
{
"node": "Aggregate",
"type": "main",
"index": 0
}
]
]
},
"Aggregate": {
"main": [
[
{
"node": "Extract Invoice Data (Gemini)",
"type": "main",
"index": 0
}
]
]
},
"Read File": {
"main": [
[
{
"node": "Check File Type",
"type": "main",
"index": 0
}
]
]
},
"Tesseract": {
"main": [
[
{
"node": "Switch",
"type": "main",
"index": 0
}
]
]
},
"Check File Type": {
"main": [
[
{
"node": "PDF Page Extract",
"type": "main",
"index": 0
}
],
[
{
"node": "Tesseract",
"type": "main",
"index": 0
}
]
]
},
"PDF Page Extract": {
"main": [
[
{
"node": "Switch",
"type": "main",
"index": 0
}
]
]
},
"Save to Airtable": {
"ai_tool": [
[
{
"node": "Extract Invoice Data (Gemini)",
"type": "ai_tool",
"index": 0
}
]
]
},
"Local File Trigger": {
"main": [
[
{
"node": "Read File",
"type": "main",
"index": 0
}
]
]
},
"Google Gemini Chat Model": {
"ai_languageModel": [
[
{
"node": "Extract Invoice Data (Gemini)",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Extract Invoice Data (Gemini)": {
"main": [
[
{
"node": "Telegram",
"type": "main",
"index": 0
}
]
]
}
}
}
Credentials you'll need
Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.
airtableTokenApigooglePalmApitelegramApi
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
This workflow contains community nodes that are only compatible with the self-hosted version of n8n.
Source: https://n8n.io/workflows/7634/ — original creator credit. Request a take-down →
Related workflows
Workflows that share integrations, category, or trigger type with this one. All free to copy and import.
Telegram Trigger receives incoming messages (text, voice, photo, document). Switch routes by message type to appropriate processors: Text → forwarded as-is. Voice → downloaded and sent to Transcribe a
Transform your Telegram messenger into a powerful, multi-modal personal or team assistant. This n8n workflow creates an intelligent agent that can understand text, voice, images, and documents, and ta
This workflow contains community nodes that are only compatible with the self-hosted version of n8n.
🤖🧑💻 AI Agent for Top n8n Creators Leaderboard Reporting. Uses httpRequest, lmChatOpenAi, executeWorkflowTrigger, toolWorkflow. Event-driven trigger; 49 nodes.
🤖🧑💻 AI Agent for Top n8n Creators Leaderboard Reporting. Uses httpRequest, lmChatOpenAi, executeWorkflowTrigger, toolWorkflow. Event-driven trigger; 49 nodes.