PO_Invoice_Match_V1
Este es unInvoice Processing, AI Summarizationflujo de automatización del dominio deautomatización que contiene 19 nodos.Utiliza principalmente nodos como If, Switch, GoogleDrive, GoogleSheets, Agent. Coincidencia automática factura-PO basada en Google Gemini AI y notificaciones por correo
- •Credenciales de API de Google Drive
- •Credenciales de API de Google Sheets
- •Clave de API de Google Gemini
Nodos utilizados (19)
{
"id": "BYzxNRz3ownaQd4R",
"meta": {
"instanceId": "e0f9933c2de40fd346dddfe612cf584d10411f4630c7e4f4f3436a3c24dfa368",
"templateCredsSetupCompleted": true
},
"name": "PO_Invoice_Matching_V1",
"tags": [],
"nodes": [
{
"id": "67440d4f-4122-4732-92a4-cf62bf064159",
"name": "Google Drive Trigger",
"type": "n8n-nodes-base.googleDriveTrigger",
"position": [
-992,
-208
],
"parameters": {
"event": "fileCreated",
"options": {},
"pollTimes": {
"item": [
{
"mode": "everyMinute"
}
]
},
"triggerOn": "specificFolder",
"folderToWatch": {
"__rl": true,
"mode": "list",
"value": "1cxnSBv6t7SAgJDJZxAOtPXO0RZH7rfKf",
"cachedResultUrl": "https://drive.google.com/drive/folders/1cxnSBv6t7SAgJDJZxAOtPXO0RZH7rfKf",
"cachedResultName": "Invoices"
}
},
"credentials": {
"googleDriveOAuth2Api": {
"id": "cGpadX1wEqUPmfdd",
"name": "Mail4matheen"
}
},
"typeVersion": 1
},
{
"id": "98a803af-25a6-4933-a0eb-29afa7fe95ac",
"name": "Descargar archivo",
"type": "n8n-nodes-base.googleDrive",
"position": [
-768,
-208
],
"parameters": {
"fileId": {
"__rl": true,
"mode": "id",
"value": "={{ $json.id }}"
},
"options": {},
"operation": "download"
},
"credentials": {
"googleDriveOAuth2Api": {
"id": "cGpadX1wEqUPmfdd",
"name": "Mail4matheen"
}
},
"typeVersion": 3
},
{
"id": "ecadedd7-ba41-4212-8ec0-57c8ce47d075",
"name": "Extraer de archivo",
"type": "n8n-nodes-base.extractFromFile",
"position": [
-544,
-208
],
"parameters": {
"options": {},
"operation": "pdf"
},
"typeVersion": 1
},
{
"id": "301efe65-f9d1-41d4-9b9b-1727eec6e2ac",
"name": "Extractor de información",
"type": "@n8n/n8n-nodes-langchain.informationExtractor",
"position": [
-320,
-208
],
"parameters": {
"text": "={{ $json.text }}",
"options": {},
"attributes": {
"attributes": [
{
"name": "Vendor Name",
"required": true,
"description": "vendor name from whom teh invoice came"
},
{
"name": "Invoice Number",
"required": true,
"description": "Invoice number"
},
{
"name": "Invoice Date",
"required": true,
"description": "Invoice date from the invoice"
},
{
"name": "Total Amount",
"type": "number",
"required": true,
"description": "Total amount including the tax amount"
},
{
"name": "PO Number",
"required": true,
"description": "PO number from invoice"
},
{
"name": "PO Date",
"required": true,
"description": "PO date from invoice"
},
{
"name": "Qty",
"type": "number",
"required": true,
"description": "Quantity from invoice"
},
{
"name": "Rate",
"type": "number",
"required": true,
"description": "rate from invoice table"
},
{
"name": "Net Amount",
"required": true,
"description": "Net Amount Excluding Tax"
}
]
}
},
"typeVersion": 1.2
},
{
"id": "ec28ded6-e060-481d-9434-c1b86130ac67",
"name": "Google Gemini Chat Model",
"type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
"position": [
-256,
16
],
"parameters": {
"options": {}
},
"credentials": {
"googlePalmApi": {
"id": "AaiLYcmkHuNwDORB",
"name": "Google Gemini(PaLM) Api account 4"
}
},
"typeVersion": 1
},
{
"id": "70cf4980-33f4-4c61-ac16-e3ea16fbf92c",
"name": "Switch",
"type": "n8n-nodes-base.switch",
"position": [
32,
-208
],
"parameters": {
"rules": {
"values": [
{
"outputKey": "Hight Dollar",
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "0e897f8d-3ee6-470a-a090-16766c79f679",
"operator": {
"type": "number",
"operation": "gte"
},
"leftValue": "={{ $json.output['Total Amount'] }}",
"rightValue": 5000
}
]
},
"renameOutput": true
},
{
"outputKey": "Direct Payment",
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "338c9b39-e0ef-43fd-9dce-efd2fed4adf7",
"operator": {
"type": "number",
"operation": "lt"
},
"leftValue": "={{ $json.output['Total Amount'] }}",
"rightValue": 5000
}
]
},
"renameOutput": true
}
]
},
"options": {}
},
"typeVersion": 3.3
},
{
"id": "23b35100-3876-4f9f-bcca-52710f96f354",
"name": "Agente de IA",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
320,
-256
],
"parameters": {
"text": "={{ $json.output['PO Number'] }}\n{{ $json.output['PO Date'] }}\n{{ $json.output.Qty }}\n{{ $json.output.Rate }}\n{{ $json.output['Net Amount'] }}",
"options": {
"systemMessage": "=You are expert in finance checker. \n\n\nYou task is to verify the the details from from PO_DB tool\n\n\nIf all are matched then update the invoice number {{ $json.output['Invoice Number'] }} in the Upadet_Row tool \n\nUpdate \"MATCHING\" OR \"NOT MATCHING\" in the matching or not matching column in Upadet_Row\n\nUpdate the comments on the matching on the \"Remarks\" column of Upadet_Row tool\n\nIf matching give a seprate output as TRUE or give as FALSE\nAlso send teh remarks to the as output\n\n{\n\"match\":TRUE\n\"remarks\":\"value\"\n\n}\n"
},
"promptType": "define",
"hasOutputParser": true
},
"typeVersion": 2.2
},
{
"id": "664fe47a-83cb-4cfd-b210-a175b0d6a312",
"name": "Google Gemini Chat Model1",
"type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
"position": [
256,
-32
],
"parameters": {
"options": {}
},
"credentials": {
"googlePalmApi": {
"id": "AaiLYcmkHuNwDORB",
"name": "Google Gemini(PaLM) Api account 4"
}
},
"typeVersion": 1
},
{
"id": "6604eac1-8429-4dad-9ede-350fd8d2b591",
"name": "PO_DB",
"type": "n8n-nodes-base.googleSheetsTool",
"position": [
384,
-32
],
"parameters": {
"options": {},
"sheetName": {
"__rl": true,
"mode": "list",
"value": "gid=0",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1T-H7zfvdx6NgBPrlveD8hXeW2q38VhtO_aO_2Sik1M0/edit#gid=0",
"cachedResultName": "Sheet1"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1T-H7zfvdx6NgBPrlveD8hXeW2q38VhtO_aO_2Sik1M0",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1T-H7zfvdx6NgBPrlveD8hXeW2q38VhtO_aO_2Sik1M0/edit?usp=drivesdk",
"cachedResultName": "PO_Data"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "xw7WRgAozbgAiIjH",
"name": "Google Sheets account 6"
}
},
"typeVersion": 4.7
},
{
"id": "10a033f5-b15d-402d-81c1-a9ee6753b90e",
"name": "Actualizar fila",
"type": "n8n-nodes-base.googleSheetsTool",
"position": [
512,
-32
],
"parameters": {
"columns": {
"value": {
"Remarks": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Remarks', ``, 'string') }}",
"PO Number": "={{ $json.output['PO Number'] }}",
"Invoice Number": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Invoice_Number', ``, 'string') }}",
"Matching or Not Matching": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Matching_or_Not_Matching', ``, 'string') }}"
},
"schema": [
{
"id": "PO Number",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "PO Number",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Vendor Name",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Vendor Name",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "PO Date",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "PO Date",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Qty",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Qty",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Rate",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Rate",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Amount",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Amount",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Tax",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Tax",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Total Amount",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Total Amount",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Invoice Number",
"type": "string",
"display": true,
"required": false,
"displayName": "Invoice Number",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Matching or Not Matching",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Matching or Not Matching",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Remarks",
"type": "string",
"display": true,
"required": false,
"displayName": "Remarks",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "row_number",
"type": "number",
"display": true,
"removed": true,
"readOnly": true,
"required": false,
"displayName": "row_number",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [
"PO Number"
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "update",
"sheetName": {
"__rl": true,
"mode": "list",
"value": "gid=0",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1T-H7zfvdx6NgBPrlveD8hXeW2q38VhtO_aO_2Sik1M0/edit#gid=0",
"cachedResultName": "Sheet1"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1T-H7zfvdx6NgBPrlveD8hXeW2q38VhtO_aO_2Sik1M0",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1T-H7zfvdx6NgBPrlveD8hXeW2q38VhtO_aO_2Sik1M0/edit?usp=drivesdk",
"cachedResultName": "PO_Data"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "xw7WRgAozbgAiIjH",
"name": "Google Sheets account 6"
}
},
"typeVersion": 4.7
},
{
"id": "860e77ab-9c58-4548-be34-7d8bbff8a06a",
"name": "If",
"type": "n8n-nodes-base.if",
"position": [
720,
-256
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "7c2043db-c9cb-4366-b04f-be71973234de",
"operator": {
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.output.match }}",
"rightValue": "true"
}
]
}
},
"typeVersion": 2.2
},
{
"id": "79803fd2-cea1-4f89-80bb-2263774b12dd",
"name": "Añadir fila en hoja",
"type": "n8n-nodes-base.googleSheets",
"position": [
928,
-416
],
"parameters": {
"columns": {
"value": {
"Qty": "={{ $('Switch').item.json.output.Qty }}",
"Tax": "0",
"Rate": "={{ $('Switch').item.json.output.Rate }}",
"Amount": "={{ $('Switch').item.json.output['Net Amount'] }}",
"Status": "Process payment",
"PO Date": "={{ $('Switch').item.json.output['PO Date'] }}",
"PO Number": "={{ $('Switch').item.json.output['PO Number'] }}",
"Vendor Name": "={{ $('Switch').item.json.output['Vendor Name'] }}",
"Total Amount": "={{ $('Switch').item.json.output['Net Amount'] }}",
"Invoice Number": "={{ $('Switch').item.json.output['Invoice Number'] }}"
},
"schema": [
{
"id": "PO Number",
"type": "string",
"display": true,
"required": false,
"displayName": "PO Number",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Vendor Name",
"type": "string",
"display": true,
"required": false,
"displayName": "Vendor Name",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "PO Date",
"type": "string",
"display": true,
"required": false,
"displayName": "PO Date",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Qty",
"type": "string",
"display": true,
"required": false,
"displayName": "Qty",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Rate",
"type": "string",
"display": true,
"required": false,
"displayName": "Rate",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Amount",
"type": "string",
"display": true,
"required": false,
"displayName": "Amount",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Tax",
"type": "string",
"display": true,
"required": false,
"displayName": "Tax",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Total Amount",
"type": "string",
"display": true,
"required": false,
"displayName": "Total Amount",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Invoice Number",
"type": "string",
"display": true,
"required": false,
"displayName": "Invoice Number",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Status",
"type": "string",
"display": true,
"required": false,
"displayName": "Status",
"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/1km2dOTGoExdJjaQvXYMlz80IvnCHSAPY6kL1AavomUo/edit#gid=0",
"cachedResultName": "Sheet1"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1km2dOTGoExdJjaQvXYMlz80IvnCHSAPY6kL1AavomUo",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1km2dOTGoExdJjaQvXYMlz80IvnCHSAPY6kL1AavomUo/edit?usp=drivesdk",
"cachedResultName": "Payment Process"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "xw7WRgAozbgAiIjH",
"name": "Google Sheets account 6"
}
},
"typeVersion": 4.7
},
{
"id": "bd4a913c-2fd9-4f19-b712-eecfc766e814",
"name": "Enviar mensaje",
"type": "n8n-nodes-base.microsoftOutlook",
"position": [
960,
-80
],
"webhookId": "c400ae17-32f7-47ed-b3bf-0fdc1769da03",
"parameters": {
"subject": "=Invoice # {{ $('Information Extractor').item.json.output['Invoice Number'] }} Not Matching\n\n\n",
"bodyContent": "=Hi Team,\n\n\nThe invoice # {{ $('Switch').item.json.output['Invoice Number'] }} doent match with PO {{ $('Switch').item.json.output['PO Number'] }}\n\nRemarks: {{ $json.output.remarks }}\n\n\nThanks",
"toRecipients": "abdul.matheen@teamhgs.com",
"additionalFields": {}
},
"credentials": {
"microsoftOutlookOAuth2Api": {
"id": "huBeQagYhJvL55GW",
"name": "Microsoft Outlook account 3"
}
},
"typeVersion": 2
},
{
"id": "fd896f77-5a44-4772-bf2b-fb258c639ec1",
"name": "Structured Output Parser",
"type": "@n8n/n8n-nodes-langchain.outputParserStructured",
"position": [
640,
96
],
"parameters": {
"jsonSchemaExample": "{\n\"match\":\"true\",\n\"remarks\":\"Invoice macthed\"\n\n}\n"
},
"typeVersion": 1.3
},
{
"id": "44330d6b-06af-4d6b-864e-91c243adb29a",
"name": "Nota adhesiva",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1104,
-592
],
"parameters": {
"width": 688,
"height": 320,
"content": "## Invoice PO matching process\n\n1. It extracts the data from invoice\n2. Using AI model extract the required fields from teh data\n3. Check if teh amount is greater than 5000 \n4. Send for review with PO detais\n5. Match teh invoice data with PO data\n6. Update the information as payment process if matchs\n7. Else send an email to fianace team as not matched\n"
},
"typeVersion": 1
},
{
"id": "b3d2c3de-2632-46d7-bbfe-a50faf2b293a",
"name": "Nota adhesiva1",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1040,
-224
],
"parameters": {
"color": 3,
"width": 1024,
"height": 224,
"content": "\n\n\n\n\n\n\n\n\n\n\n\n\n\nExtract the invoice data and extarct the required information from invoice"
},
"typeVersion": 1
},
{
"id": "2c8ccecd-6fdf-4bbf-995c-3d6269966477",
"name": "Nota adhesiva2",
"type": "n8n-nodes-base.stickyNote",
"position": [
0,
-432
],
"parameters": {
"width": 528,
"content": "Check the amount is greater than 5000 and validated with PO database"
},
"typeVersion": 1
},
{
"id": "6826e75f-1496-4abd-b2a3-4ebabe0b9dd5",
"name": "Nota adhesiva3",
"type": "n8n-nodes-base.stickyNote",
"position": [
784,
-592
],
"parameters": {
"width": 320,
"content": "Approval for payment process"
},
"typeVersion": 1
},
{
"id": "ac78f8cc-0413-40df-a6df-8de8175b9003",
"name": "Nota adhesiva4",
"type": "n8n-nodes-base.stickyNote",
"position": [
880,
80
],
"parameters": {
"width": 320,
"content": "Send email if not match"
},
"typeVersion": 1
}
],
"active": false,
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"versionId": "d1ea1b19-2a18-45af-97df-1bf1e2710996",
"connections": {
"860e77ab-9c58-4548-be34-7d8bbff8a06a": {
"main": [
[
{
"node": "79803fd2-cea1-4f89-80bb-2263774b12dd",
"type": "main",
"index": 0
}
],
[
{
"node": "bd4a913c-2fd9-4f19-b712-eecfc766e814",
"type": "main",
"index": 0
}
]
]
},
"6604eac1-8429-4dad-9ede-350fd8d2b591": {
"ai_tool": [
[
{
"node": "23b35100-3876-4f9f-bcca-52710f96f354",
"type": "ai_tool",
"index": 0
}
]
]
},
"70cf4980-33f4-4c61-ac16-e3ea16fbf92c": {
"main": [
[
{
"node": "23b35100-3876-4f9f-bcca-52710f96f354",
"type": "main",
"index": 0
}
],
[
{
"node": "79803fd2-cea1-4f89-80bb-2263774b12dd",
"type": "main",
"index": 0
}
]
]
},
"23b35100-3876-4f9f-bcca-52710f96f354": {
"main": [
[
{
"node": "860e77ab-9c58-4548-be34-7d8bbff8a06a",
"type": "main",
"index": 0
}
]
]
},
"10a033f5-b15d-402d-81c1-a9ee6753b90e": {
"ai_tool": [
[
{
"node": "23b35100-3876-4f9f-bcca-52710f96f354",
"type": "ai_tool",
"index": 0
}
]
]
},
"98a803af-25a6-4933-a0eb-29afa7fe95ac": {
"main": [
[
{
"node": "ecadedd7-ba41-4212-8ec0-57c8ce47d075",
"type": "main",
"index": 0
}
]
]
},
"ecadedd7-ba41-4212-8ec0-57c8ce47d075": {
"main": [
[
{
"node": "301efe65-f9d1-41d4-9b9b-1727eec6e2ac",
"type": "main",
"index": 0
}
]
]
},
"67440d4f-4122-4732-92a4-cf62bf064159": {
"main": [
[
{
"node": "98a803af-25a6-4933-a0eb-29afa7fe95ac",
"type": "main",
"index": 0
}
]
]
},
"301efe65-f9d1-41d4-9b9b-1727eec6e2ac": {
"main": [
[
{
"node": "70cf4980-33f4-4c61-ac16-e3ea16fbf92c",
"type": "main",
"index": 0
}
]
]
},
"ec28ded6-e060-481d-9434-c1b86130ac67": {
"ai_languageModel": [
[
{
"node": "301efe65-f9d1-41d4-9b9b-1727eec6e2ac",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"fd896f77-5a44-4772-bf2b-fb258c639ec1": {
"ai_outputParser": [
[
{
"node": "23b35100-3876-4f9f-bcca-52710f96f354",
"type": "ai_outputParser",
"index": 0
}
]
]
},
"664fe47a-83cb-4cfd-b210-a175b0d6a312": {
"ai_languageModel": [
[
{
"node": "23b35100-3876-4f9f-bcca-52710f96f354",
"type": "ai_languageModel",
"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 - Procesamiento de facturas, Resumen de IA
¿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
Abdul Matheen
@matheenI am an automation consultant at a multinational company with 18 years of experience in automation technologies, including RPA, Python, and VBA. I am also expanding my expertise by learning AI Agents to further enhance my skill set. Currently serving as delivery manager for a automation team.
Compartir este flujo de trabajo