AutomationFlowsAI & RAG › Automated Invoice Processing System with OCR & AI - Ap Automation with Airtable

Automated Invoice Processing System with OCR & AI - Ap Automation with Airtable

ByMilan Vasarhelyi - SmoothWork @vasarmilan on n8n.io

[](https://www.youtube.com/watch?v=rfu4MSvtpAw)

Event trigger★★★★☆ complexityAI-powered29 nodesLm Open AiOutput Parser StructuredChain LlmGmailOpenAIHTTP RequestAirtableInformation Extractor
AI & RAG Trigger: Event Nodes: 29 Complexity: ★★★★☆ AI nodes: yes Added:

This workflow corresponds to n8n.io template #4434 — we link there as the canonical source.

This workflow follows the Airtable → Chainllm 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 →

Download .json
{
  "meta": {
    "templateId": "2320",
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "7076854e-c7e8-45b5-9e5e-16678bffa254",
      "name": "OpenAI Model",
      "type": "@n8n/n8n-nodes-langchain.lmOpenAi",
      "position": [
        980,
        1380
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o",
          "cachedResultName": "gpt-4o"
        },
        "options": {
          "temperature": 0
        }
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "00819f1c-2c60-4b7c-b395-445ec05fd898",
      "name": "Structured Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        1160,
        1380
      ],
      "parameters": {
        "jsonSchema": "{\n  \"Invoice Date\":            { \"type\": \"string\", \"format\": \"date\" },\n\"Due Date\":            { \"type\": \"string\", \"format\": \"date\" },\n  \"Invoice Number\":          { \"type\": \"string\" },\n  \"Vendor Name\":           { \"type\": \"string\" },\n  \"Vendor Tax ID\":         { \"type\": \"string\" },\n  \"Product Name\": { \"type\": \"string\" },\n  \"Price without Tax\":       { \"type\": \"number\" },\n  \"Price with Tax\":          { \"type\": \"number\" }\n}"
      },
      "typeVersion": 1.1
    },
    {
      "id": "1acf2c60-c2b9-4f78-94a4-0711c8bd71ab",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -340,
        100
      ],
      "parameters": {
        "color": 4,
        "width": 760,
        "height": 533,
        "content": "# Invoice Processing Automation\n\n### This template is the automation behind a simple incoming invoice automation tool (AP automation) tool built in Airtable.\n\n### Follow the instructions below to get all parts working!\n\n## Video walkthrough and demo: https://www.youtube.com/watch?v=rfu4MSvtpAw\n\n## To get a similar business tool tailored to your processes, book a call with us: https://automable.ai/book-a-call/, or write to me at: vasarmilan@gmail.com\n\n# **Step by step setup instructions below: \u2b07\ufe0f\u2b07\ufe0f**"
      },
      "typeVersion": 1
    },
    {
      "id": "5f9b507f-4dc1-4853-bf71-a64f2f4b55c1",
      "name": "Map Output",
      "type": "n8n-nodes-base.set",
      "position": [
        1320,
        1220
      ],
      "parameters": {
        "mode": "raw",
        "options": {},
        "jsonOutput": "={{ $json.output }}"
      },
      "typeVersion": 3.3
    },
    {
      "id": "d22744cd-151d-4b92-b4f2-4a5b9ceb4ee7",
      "name": "Apply Data Extraction Rules",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        980,
        1220
      ],
      "parameters": {
        "text": "=Given the following invoice in the <invoice> xml tags, extract the following information as listed below.\n\nIf you cannot the information for a specific item, then leave blank and skip to the next. Do **not come up with example or hallucinated information in any case!**\n\nInvoice Date format: YYYY/MM/DD\n\n{\n  \"Invoice Date\":            { \"type\": \"string\", \"format\": \"date\" },\n  \"Due Date\":            { \"type\": \"string\", \"format\": \"date\" },\n  \"Invoice Number\":          { \"type\": \"string\" },\n  \"Vendor Name\":           { \"type\": \"string\" },\n  \"Vendor Tax ID\":         { \"type\": \"string\" },\n  \"Product Name\": { \"type\": \"string\" },\n  \"Price without Tax\":       { \"type\": \"number\" },\n  \"Price with Tax\":          { \"type\": \"number\" }\n}\n\nIf no tax displayed, price with and without should be the same!\n\n<invoice>{{ $json.choices[0].message.content }}</invoice>",
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 1.4
    },
    {
      "id": "31b27190-bf01-4d2a-82ad-621e89bfbf6f",
      "name": "Gmail1",
      "type": "n8n-nodes-base.gmail",
      "position": [
        820,
        520
      ],
      "parameters": {
        "simple": false,
        "filters": {
          "q": "in:inbox has:attachment invoice -label:invoice_checked "
        },
        "options": {
          "downloadAttachments": true
        },
        "operation": "getAll"
      },
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "955fd212-11f7-4b2d-8e5c-a297509cbf08",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        760,
        360
      ],
      "parameters": {
        "width": 230,
        "height": 280,
        "content": "Gets all messages that:\n1) Have an attachment\n2) Do not have the label invoice_checked\n3) Text matches invoice"
      },
      "typeVersion": 1
    },
    {
      "id": "712495a2-0c3d-452b-bd10-b19f6bea2178",
      "name": "Get all img_url",
      "type": "n8n-nodes-base.set",
      "position": [
        1620,
        520
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "7715e33a-c5cc-4a22-aa28-ac19a24bbd7c",
              "name": "url",
              "type": "string",
              "value": "={{ $json.Url }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "caa879e0-54c5-40c8-83b2-b59b1b74af67",
      "name": "Analyze image",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        660,
        1220
      ],
      "parameters": {
        "text": "You can see the image of an invoice.\n\nExtract the following information as listed below.\n\nIn any way, extract everything from the image.\n\nIf you cannot the information for a specific item, then leave blank and skip to the next. Do **not come up with example or hallucinated information in any case!**\n\nInvoice date\nInvoice Due Date\n-- comment: sometimes instead of an explicit date it would have \"immediate\" payment, then it's the same as date; or eg. \"30 days from receipt\" in which case it's date + 30 days etc.)\ninvoice number\nSupplier name\nSupplier Tax ID\nName of Product or Service (if there are multiple, make it a general name, such as \"marketing services\" or \"computer parts and accessories\")\nPrice without Tax\nPrice with Tax (total price)\nIf no tax displayed, price with and without should be the same!\n\nRespond in a nice structured, easy to read format.\n",
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o",
          "cachedResultName": "GPT-4O"
        },
        "options": {},
        "resource": "image",
        "simplify": false,
        "imageUrls": "={{ $('Get image data').item.json.Url }}",
        "operation": "analyze"
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.8
    },
    {
      "id": "b0052237-4129-460f-ae38-69680760c78b",
      "name": "Get image data",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        1360,
        520
      ],
      "parameters": {
        "options": {},
        "fieldToSplitOut": "Files"
      },
      "typeVersion": 1
    },
    {
      "id": "f7752ed2-5497-42a9-ab41-4fcee7faf52a",
      "name": "PDF -> JPG - ConvertAPI",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1120,
        520
      ],
      "parameters": {
        "url": "https://v2.convertapi.com/convert/pdf/to/jpg",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "contentType": "multipart-form-data",
        "sendHeaders": true,
        "authentication": "genericCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "StoreFile",
              "value": "true"
            },
            {
              "name": "ImageOutputFormat",
              "value": "jpg"
            },
            {
              "name": "File",
              "parameterType": "formBinaryData",
              "inputDataFieldName": "attachment_0"
            }
          ]
        },
        "genericAuthType": "httpHeaderAuth",
        "headerParameters": {
          "parameters": [
            {}
          ]
        }
      },
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      },
      "retryOnFail": true,
      "typeVersion": 4.2,
      "waitBetweenTries": 5000
    },
    {
      "id": "0625e6f0-d8ed-469e-a551-e82225a97144",
      "name": "Get list of vendors",
      "type": "n8n-nodes-base.airtable",
      "position": [
        1020,
        820
      ],
      "parameters": {
        "base": {
          "__rl": true,
          "mode": "list",
          "value": "appFMuGzhsUxbFKUh",
          "cachedResultUrl": "https://airtable.com/appFMuGzhsUxbFKUh",
          "cachedResultName": "Invoice Processing"
        },
        "table": {
          "__rl": true,
          "mode": "list",
          "value": "tblDSjYz7MBFPh0PR",
          "cachedResultUrl": "https://airtable.com/appFMuGzhsUxbFKUh/tblDSjYz7MBFPh0PR",
          "cachedResultName": "Vendors"
        },
        "options": {},
        "operation": "search"
      },
      "credentials": {
        "airtableTokenApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "6d808c56-0449-43c8-afdb-2097a240ef87",
      "name": "Merge",
      "type": "n8n-nodes-base.merge",
      "position": [
        1480,
        800
      ],
      "parameters": {
        "mode": "combine",
        "options": {},
        "combineBy": "combineAll"
      },
      "typeVersion": 3.1
    },
    {
      "id": "c7d36fae-d497-4ed2-be0f-2b2a699fb9f6",
      "name": "Edit Fields",
      "type": "n8n-nodes-base.set",
      "position": [
        1220,
        820
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "d8a97fc9-0ca8-4a27-a305-107409755d78",
              "name": "vendors",
              "type": "array",
              "value": "={{ $input.all().map(({ json: { id, Name } }) => ({ id, Name })) }}"
            }
          ]
        }
      },
      "executeOnce": true,
      "typeVersion": 3.4
    },
    {
      "id": "69fbdb0d-8eff-4de2-bb9c-8261ebe7f67a",
      "name": "Information Extractor",
      "type": "@n8n/n8n-nodes-langchain.informationExtractor",
      "position": [
        1700,
        1320
      ],
      "parameters": {
        "text": "=List of vendors:\n{{ JSON.stringify($json.vendors) }}\n\nVendor info from the invoice:\nVendor name: {{ $json['Vendor Name'] }}\nVendor Tax ID: {{ $json['Vendor Tax ID'] }}\n\nRespond **only** with the ",
        "options": {
          "systemPromptTemplate": "You are an expert extraction algorithm.\nOnly extract relevant information from the text.\nIf you do not know the value of an attribute asked to extract, you may omit the attribute's value."
        },
        "attributes": {
          "attributes": [
            {
              "name": "vendor_id",
              "required": true,
              "description": "Vendor ID. Or empty string (\"\") if there is no match."
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "134cb237-5500-4575-802a-ae8759104f92",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1720,
        1500
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o",
          "cachedResultName": "gpt-4o"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "4b32647c-1521-4279-8223-dbbc1c1eb714",
      "name": "Merge1",
      "type": "n8n-nodes-base.merge",
      "position": [
        2240,
        700
      ],
      "parameters": {
        "mode": "combine",
        "options": {},
        "combineBy": "combineByPosition",
        "numberInputs": 3
      },
      "typeVersion": 3.1
    },
    {
      "id": "6ad25f9f-f1e5-4468-9862-b0c93bc9b19d",
      "name": "Airtable",
      "type": "n8n-nodes-base.airtable",
      "position": [
        2480,
        700
      ],
      "parameters": {
        "base": {
          "__rl": true,
          "mode": "list",
          "value": "appFMuGzhsUxbFKUh",
          "cachedResultUrl": "https://airtable.com/appFMuGzhsUxbFKUh",
          "cachedResultName": "Invoice Processing"
        },
        "table": {
          "__rl": true,
          "mode": "list",
          "value": "tblc95K9ITUgglNIC",
          "cachedResultUrl": "https://airtable.com/appFMuGzhsUxbFKUh/tblc95K9ITUgglNIC",
          "cachedResultName": "Invoices"
        },
        "columns": {
          "value": {
            "Vendor": "={{[ $json.output.vendor_id  ]}}",
            "Invoice": "={{ [ { url: $json.url }] }}",
            "Due Date": "={{ $json['Due Date'] || null }}",
            "Invoice Date": "={{ $json['Invoice Date'] }}",
            "Product Name": "={{ $json['Product Name'] }}",
            "Invoice Number": "=Invoice {{ $json['Invoice Number'] }}",
            "Price with Tax": "={{ $json['Price with Tax'] }}",
            "Price without Tax": "={{ $json['Price without Tax'] }}"
          },
          "schema": [
            {
              "id": "id",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": true,
              "required": false,
              "displayName": "id",
              "defaultMatch": true
            },
            {
              "id": "Invoice Number",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Invoice Number",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Invoice Date",
              "type": "dateTime",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Invoice Date",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Due Date",
              "type": "dateTime",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Due Date",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Product Name",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Product Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Price without Tax",
              "type": "number",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Price without Tax",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Price with Tax",
              "type": "number",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Price with Tax",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Vendor",
              "type": "array",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Vendor",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Vendor Name",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": true,
              "required": false,
              "displayName": "Vendor Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Invoice",
              "type": "array",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Invoice",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Approve",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": true,
              "required": false,
              "displayName": "Approve",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Status",
              "type": "options",
              "display": true,
              "options": [
                {
                  "name": "New",
                  "value": "New"
                },
                {
                  "name": "Approved",
                  "value": "Approved"
                }
              ],
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "Invoice Number"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {
          "typecast": true
        },
        "operation": "upsert"
      },
      "credentials": {
        "airtableTokenApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "9e775f8d-4af5-4212-8c65-36e3e5c161f2",
      "name": "Gmail Trigger",
      "type": "n8n-nodes-base.gmailTrigger",
      "position": [
        580,
        520
      ],
      "parameters": {
        "filters": {},
        "pollTimes": {
          "item": [
            {
              "mode": "everyHour"
            }
          ]
        }
      },
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "39afb11e-f98a-4d50-b31c-4b1806b6e483",
      "name": "Gmail",
      "type": "n8n-nodes-base.gmail",
      "position": [
        2680,
        700
      ],
      "parameters": {
        "labelIds": [
          "Label_292293622344874549"
        ],
        "messageId": "={{ $('Gmail1').item.json.id }}",
        "operation": "addLabels"
      },
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "ce68d5b8-1532-459f-b6fe-33f46e3f9186",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -340,
        660
      ],
      "parameters": {
        "color": 5,
        "width": 440,
        "height": 460,
        "content": "# *1. Set up Airtable*\n\n## 1 - [Register an Airtable account here](https://airtable.partnerlinks.io/xfs4x6q28m4x)\n\n## 2 - Duplicate [this base](https://airtable.com/appFMuGzhsUxbFKUh/shrOP5l52wxZ5IYSI)\n\n## 3 - Follow the [n8n Airtable credential instructions](https://docs.n8n.io/integrations/builtin/credentials/airtable/). PAT is better. Add the credential to the Airtable nodes.\n\n## 4 - Click to both Airtable nodes on the right, and choose the table on the yellow note \u27a1\ufe0f\u27a1\ufe0f"
      },
      "typeVersion": 1
    },
    {
      "id": "89c5f457-fe92-43d2-b4ca-7cd5624f5cb1",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -340,
        1140
      ],
      "parameters": {
        "color": 5,
        "width": 440,
        "height": 420,
        "content": "# 2. Set Up ConvertAPI\n\n## 1 - [Register a ConvertAPI account here](https://convertapi.com?ref=cq5du)\n\n## 2 - Get an API key, and save it somewhere safe\n\n## 3 - Create a Header Auth credential in Credentials, and add it to the \"PDF -> JPG - ConvertAPI\" Node in the automation."
      },
      "typeVersion": 1
    },
    {
      "id": "896d3cd8-079e-4976-ae6b-61b73cd8c100",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2420,
        600
      ],
      "parameters": {
        "height": 100,
        "content": "### TODO: Change the Base to the duplicated base, and the table to \"Invoices\""
      },
      "typeVersion": 1
    },
    {
      "id": "92a526d0-c116-4b1e-9ad2-5c1f45e0a6b8",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        960,
        960
      ],
      "parameters": {
        "height": 100,
        "content": "### TODO: Change the Base to the duplicated base, and the table to \"Vendors\""
      },
      "typeVersion": 1
    },
    {
      "id": "f4635b8b-25d5-4e23-af98-0d2d25040d90",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -340,
        1580
      ],
      "parameters": {
        "color": 5,
        "width": 440,
        "height": 420,
        "content": "# 3. Set up Gmail\n\n## 1 - Create the \"invoice_checked\" label\n\n## 2 - [Follow the instructions](https://docs.n8n.io/integrations/builtin/credentials/google/oauth-single-service/#finish-your-n8n-credential) by n8n to set this up. Video available at the end of the article\n\n## 3 - Choose your Gmail credentials, and add to all Gmail nodes if needed."
      },
      "typeVersion": 1
    },
    {
      "id": "903f5ee9-fde9-4225-949f-d02b0e820bbd",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -340,
        2020
      ],
      "parameters": {
        "color": 5,
        "width": 440,
        "height": 220,
        "content": "# 4. Set up OpenAI\n\n## Follow the [n8n instructions](https://docs.n8n.io/integrations/builtin/credentials/openai/) to connect your OpenAI platform account."
      },
      "typeVersion": 1
    },
    {
      "id": "58c3cdaf-3912-40d3-9b95-8b610ae95540",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1040,
        440
      ],
      "parameters": {
        "height": 100,
        "content": "### TODO: Add the ConvertAPI Header Auth"
      },
      "typeVersion": 1
    },
    {
      "id": "ac79181d-0434-4be0-8f5f-173255064b96",
      "name": "Sticky Note10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        460,
        -100
      ],
      "parameters": {
        "color": 5,
        "width": 760,
        "height": 420,
        "content": "# Made by:\n## Milan @ SmoothWork - [Book a Free Consulting Call](https://smoothwork.ai/book-a-call/)\n![Milan](https://gravatar.com/avatar/95700d17ba300a9f14c1b8cacf933df7720027b3adda9cbe6183d89142925422?r=pg&d=retro&size=100)\n\n\n### We help businesses eliminate busywork by building compact business tools tailored to your process.\n\n\ud83d\udce7 hello@smoothwork.ai\n\u25b6\ufe0f [Check us on YouTube](https://www.youtube.com/@vasarmilan)\n\ud83d\udcde [Book a Free Consulting Call](https://smoothwork.ai/book-a-call/)\n\ud83d\udcbc [Add me on Linkedin](https://www.linkedin.com/in/mil%C3%A1n-v%C3%A1s%C3%A1rhelyi-3a9985123/)\n"
      },
      "typeVersion": 1
    },
    {
      "id": "eb3d40d0-6f5b-4fac-bf16-668c2fd90e07",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        120,
        660
      ],
      "parameters": {
        "width": 400,
        "height": 280,
        "content": "# Video Introduction\n[![image.png](https://i.ytimg.com/vi/rfu4MSvtpAw/hqdefault.jpg?sqp=-oaymwEnCNACELwBSFryq4qpAxkIARUAAIhCGAHYAQHiAQoIGBACGAY4AUAB&rs=AOn4CLCRFYblexOaD3MYHJ7QFgjTPfwfVA)](https://www.youtube.com/watch?v=rfu4MSvtpAw)"
      },
      "typeVersion": 1
    }
  ],
  "connections": {
    "Merge": {
      "main": [
        [
          {
            "node": "Information Extractor",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Gmail1": {
      "main": [
        [
          {
            "node": "PDF -> JPG - ConvertAPI",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge1": {
      "main": [
        [
          {
            "node": "Airtable",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Airtable": {
      "main": [
        [
          {
            "node": "Gmail",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Map Output": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          },
          {
            "node": "Merge1",
            "type": "main",
            "index": 2
          }
        ]
      ]
    },
    "Edit Fields": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Model": {
      "ai_languageModel": [
        [
          {
            "node": "Apply Data Extraction Rules",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Analyze image": {
      "main": [
        [
          {
            "node": "Apply Data Extraction Rules",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Gmail Trigger": {
      "main": [
        [
          {
            "node": "Gmail1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get image data": {
      "main": [
        [
          {
            "node": "Get all img_url",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get all img_url": {
      "main": [
        [
          {
            "node": "Analyze image",
            "type": "main",
            "index": 0
          },
          {
            "node": "Merge1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Information Extractor",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Get list of vendors": {
      "main": [
        [
          {
            "node": "Edit Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Information Extractor": {
      "main": [
        [
          {
            "node": "Merge1",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "PDF -> JPG - ConvertAPI": {
      "main": [
        [
          {
            "node": "Get image data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Apply Data Extraction Rules",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Apply Data Extraction Rules": {
      "main": [
        [
          {
            "node": "Map Output",
            "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.

Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

[](https://www.youtube.com/watch?v=rfu4MSvtpAw)

Source: https://n8n.io/workflows/4434/ — original creator credit. Request a take-down →

More AI & RAG workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

AI & RAG

Typeform IA - YT. Uses typeformTrigger, agent, lmChatOpenAi, toolWorkflow. Event-driven trigger; 75 nodes.

Typeform Trigger, Agent, OpenAI Chat +7
AI & RAG

True Multi-Offer Campaigns Promote any mix of products, services or solutions in one run; no separate workflows needed. SMTP Load Balancing A Switch node rotates sends across five Gmail/SMTP accounts

HTTP Request, OpenAI, Chain Llm +3
AI & RAG

Recruiting agencies, executive search firms, and in-house talent teams that want to automate candidate sourcing and prequalification. Instead of spending hours searching, scoring, and writing outreach

Form Trigger, Output Parser Autofixing, OpenAI Chat +6
AI & RAG

This n8n workflow automates sales processes using AI agents integrated with Airtable as a CRM and Gmail for email handling. It consists of two main workflows: one for handling Airtable status changes

Airtable Trigger, Agent, OpenAI Chat +9
AI & RAG

mails2notion V2. Uses lmChatOpenAi, toolCalculator, outputParserStructured, gmail. Event-driven trigger; 38 nodes.

OpenAI Chat, Tool Calculator, Output Parser Structured +5