{
  "name": "Mistral OCR, GPT-4o-mini, and Google Sheets integration for enhanced data processing",
  "nodes": [
    {
      "id": "fcfc23ba-55ac-4aa1-a83b-583e66e3f351",
      "name": "Main Overview",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -240,
        -64
      ],
      "parameters": {
        "width": 380,
        "height": 732,
        "content": "## Invoice OCR Processor with Mistral AI\n\nAutomatically extract data from invoices using Mistral's dedicated OCR model and GPT-4o-mini. Process multiple PDF, PNG, or JPG invoices, extract financial fi"
      }
    },
    {
      "id": "1776f4d6-46c9-45a9-bcba-c5f495287ba4",
      "name": "Warning - Credentials",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        160,
        -64
      ],
      "parameters": {
        "width": 844,
        "height": 372,
        "content": "## ⚠️ Required Credentials\n\n**1. Mistral API Key**\n- Go to [console.mistral.ai](https://console.mistral.ai)\n- Create HTTP Header Auth credential in n8n\n- Header Name: `Authorization`\n- Header Value: `"
      }
    },
    {
      "id": "367c1a8f-4b1e-48bc-b735-84ba4dc55f90",
      "name": "Section 1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        160,
        336
      ],
      "parameters": {
        "width": 392,
        "height": 328,
        "content": "## 1. Input"
      }
    },
    {
      "id": "b2a8ec06-1c62-497c-8c40-53786e5acf4d",
      "name": "Section 2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        576,
        336
      ],
      "parameters": {
        "width": 728,
        "height": 328,
        "content": "## 2. OCR Processing"
      }
    },
    {
      "id": "e7561968-3f94-4fb8-a5c4-3fadb9e289a9",
      "name": "Section 3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1328,
        336
      ],
      "parameters": {
        "width": 440,
        "height": 328,
        "content": "## 3. AI Extraction"
      }
    },
    {
      "id": "8c43ab4e-a9b6-4cbf-a829-a1515507b241",
      "name": "Section 4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1792,
        336
      ],
      "parameters": {
        "width": 352,
        "height": 328,
        "content": "## 4. Output"
      }
    },
    {
      "id": "e14a7935-b21e-4901-9f0c-5591ac7e05d2",
      "name": "Invoice Upload Form",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        208,
        416
      ]
    },
    {
      "id": "1f06b5ad-962a-40da-9222-0cfb85a55f1e",
      "name": "Split Files",
      "type": "n8n-nodes-base.code",
      "position": [
        384,
        416
      ]
    },
    {
      "id": "a6a110ad-3317-421e-aa42-c6b0f9900b8d",
      "name": "Loop",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        624,
        416
      ]
    },
    {
      "id": "8ead97c6-2786-4cc8-9beb-67730fbb1ced",
      "name": "Prepare OCR Request",
      "type": "n8n-nodes-base.code",
      "position": [
        832,
        416
      ]
    },
    {
      "id": "681609e2-c494-4be6-8899-22ec68af4e9c",
      "name": "Mistral OCR",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        992,
        416
      ]
    },
    {
      "id": "7ea867d4-60ca-4877-a330-2c3bdfe148b3",
      "name": "Format OCR Text",
      "type": "n8n-nodes-base.code",
      "position": [
        1152,
        416
      ]
    },
    {
      "id": "116842fd-81f1-4101-868e-c16ba286bd90",
      "name": "OpenAI Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1360,
        560
      ]
    },
    {
      "id": "478eb4e0-8b77-436b-9d77-7520db07db9f",
      "name": "Extract Invoice Fields",
      "type": "@n8n/n8n-nodes-langchain.informationExtractor",
      "position": [
        1360,
        416
      ]
    },
    {
      "id": "ace27530-d7a9-48c5-bae5-7b64e10737bc",
      "name": "Validate & Score",
      "type": "n8n-nodes-base.code",
      "position": [
        1648,
        416
      ]
    },
    {
      "id": "5c5cc09b-5b67-424f-b96f-b6ffc0ae3f17",
      "name": "Save to Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1840,
        416
      ]
    },
    {
      "id": "3ee3a3d3-991d-4183-95af-82dbacecd9f4",
      "name": "Rate Limit",
      "type": "n8n-nodes-base.wait",
      "position": [
        1984,
        416
      ]
    }
  ],
  "connections": {
    "Loop": {
      "main": [
        [],
        [
          {
            "node": "Prepare OCR Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Rate Limit": {
      "main": [
        [
          {
            "node": "Loop",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Mistral OCR": {
      "main": [
        [
          {
            "node": "Format OCR Text",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Files": {
      "main": [
        [
          {
            "node": "Loop",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Model": {
      "ai_languageModel": [
        [
          {
            "node": "Extract Invoice Fields",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Save to Sheets": {
      "main": [
        [
          {
            "node": "Rate Limit",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format OCR Text": {
      "main": [
        [
          {
            "node": "Extract Invoice Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Validate & Score": {
      "main": [
        [
          {
            "node": "Save to Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Invoice Upload Form": {
      "main": [
        [
          {
            "node": "Split Files",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare OCR Request": {
      "main": [
        [
          {
            "node": "Mistral OCR",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Invoice Fields": {
      "main": [
        [
          {
            "node": "Validate & Score",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}