{
  "name": "Automate invoice-bank statement reconciliation with Mistral AI and OpenAI GPT-4",
  "nodes": [
    {
      "id": "451c356d-2215-4c59-8f92-40678b080c2b",
      "name": "When clicking ‘Execute workflow’",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        224,
        0
      ]
    },
    {
      "id": "8e42332e-f1cb-41f8-a0e1-f37b6ab3e75a",
      "name": "Extract text",
      "type": "n8n-nodes-base.mistralAi",
      "position": [
        1344,
        0
      ]
    },
    {
      "id": "a8014539-db77-4ade-97c5-d42077119291",
      "name": "Get Bank Statement",
      "type": "n8n-nodes-base.microsoftOneDrive",
      "position": [
        896,
        0
      ]
    },
    {
      "id": "822968f4-1066-417d-9521-d1064f511bb7",
      "name": "Code in JavaScript",
      "type": "n8n-nodes-base.code",
      "position": [
        672,
        0
      ]
    },
    {
      "id": "3a9cc7b1-aeeb-4f5f-b61f-db5fe3dfc402",
      "name": "OpenAI Chat Model1",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1568,
        224
      ]
    },
    {
      "id": "99f88b81-4e58-4a5d-a47a-67f6ba0771a4",
      "name": "Get Transaction, Matches, Summary",
      "type": "n8n-nodes-base.code",
      "position": [
        1920,
        0
      ]
    },
    {
      "id": "b9395a80-9e22-4e11-8e8e-85f558cc618f",
      "name": "Extract the Data from Unstructured File",
      "type": "n8n-nodes-base.microsoftOneDrive",
      "position": [
        1120,
        0
      ]
    },
    {
      "id": "464d6980-ee91-4509-b433-012adb2bcf88",
      "name": "Process the Invoice Vs Bank Statement Data",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1568,
        0
      ]
    },
    {
      "id": "84487907-0767-4877-89cf-d8ce56a9ac39",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -560,
        -432
      ],
      "parameters": {
        "width": 2080,
        "height": 272,
        "content": "## **Problem Statement**\n### Cash reconciliation is one of the most time-consuming and error-prone processes for Accounts Receivable teams. Every day, specialists need to take the bank statement, scan"
      }
    },
    {
      "id": "f02dc91c-34e1-48b5-8aca-51ad5c3001db",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -560,
        -64
      ],
      "parameters": {
        "width": 736,
        "height": 288,
        "content": "## **Value**:\n\n### Time saved: Removes repetitive manual matching.\n### Cash flow visibility: Gives near real-time reconciliation metrics.\n### Error reduction: Uses AI confidence scoring and reasons fo"
      }
    },
    {
      "id": "5e1cd291-8e85-4869-ad70-f8a3958ac55b",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        208,
        176
      ],
      "parameters": {
        "width": 1312,
        "height": 176,
        "content": "## ***Input***:\n\n### Open invoices are loaded from Excel.\n### Daily bank statement is fetched from OneDrive.\n### OCR extracts transaction data from the statement."
      }
    },
    {
      "id": "a45de2dd-7ee6-4fa9-a167-d22ceab156e2",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1712,
        240
      ],
      "parameters": {
        "width": 784,
        "height": 240,
        "content": "## ***AI Processing***:\n\n### Both invoice data and bank transactions are passed into an OpenAI Chat model.\n### The model evaluates and returns:\n Transaction → Invoice matches\n Confidence scores\n Unmat"
      }
    },
    {
      "id": "123cec6b-f238-4a07-a75f-2646c3ce0106",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        208,
        368
      ],
      "parameters": {
        "width": 1328,
        "height": 496,
        "content": "## ***Post-Processing***:\n\n### Custom code nodes parse the AI output.\n### Results are converted into a structured table with columns like:\n\nBank Transaction Date\nDescription\nAmount\nERP Invoice Number("
      }
    },
    {
      "id": "38449472-1724-44cc-aa6b-af80c8eaeb6b",
      "name": "Get Invoice Data",
      "type": "n8n-nodes-base.microsoftExcel",
      "position": [
        448,
        0
      ]
    },
    {
      "id": "7c23ec26-e63b-4dfe-b82b-79b5a892c91d",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -560,
        272
      ],
      "parameters": {
        "width": 704,
        "height": 176,
        "content": "***Possible Enhancements***: \n\n1. Getting Invoice data from Data Table such as Snowflake, Databricks\n2. Getting Bank Statement from Bank accounts directly \n3. Posting the Data back to either ERP Syste"
      }
    }
  ],
  "connections": {
    "Extract text": {
      "main": [
        [
          {
            "node": "Process the Invoice Vs Bank Statement Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Invoice Data": {
      "main": [
        [
          {
            "node": "Code in JavaScript",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code in JavaScript": {
      "main": [
        [
          {
            "node": "Get Bank Statement",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Bank Statement": {
      "main": [
        [
          {
            "node": "Extract the Data from Unstructured File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "Process the Invoice Vs Bank Statement Data",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Get Transaction, Matches, Summary": {
      "main": [
        []
      ]
    },
    "When clicking ‘Execute workflow’": {
      "main": [
        [
          {
            "node": "Get Invoice Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract the Data from Unstructured File": {
      "main": [
        [
          {
            "node": "Extract text",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Process the Invoice Vs Bank Statement Data": {
      "main": [
        [
          {
            "node": "Get Transaction, Matches, Summary",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}