{
  "name": "Log Telegram receipt images to Excel 365 using Tesseract OCR and GPT-4.1-mini",
  "nodes": [
    {
      "id": "819bc3ef-5fd4-49b5-9d9b-79c64ce99257",
      "name": "Telegram Trigger",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        -560,
        -208
      ]
    },
    {
      "id": "afb73b10-60bf-4ba3-96cb-f0891f6ac5a7",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -592,
        -320
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "46c06288-e7a5-415e-a468-00eb254ffb87",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        208,
        -160
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "25e7ac1a-0def-4a36-80ed-ebce8568e05b",
      "name": "Get Configurations",
      "type": "n8n-nodes-base.microsoftExcel",
      "position": [
        1168,
        128
      ]
    },
    {
      "id": "c1e967bf-9e1b-435f-bafd-80a273e4125c",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        624,
        144
      ]
    },
    {
      "id": "26f32c5e-b7bd-4938-928b-522480d83b8d",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1136,
        -144
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "ff0a7696-9d59-4fea-8170-c579dbf7f9f0",
      "name": "Tesseract OCR",
      "type": "n8n-nodes-tesseractjs.tesseractNode",
      "position": [
        448,
        -48
      ]
    },
    {
      "id": "cc65e743-24a7-4020-953c-acc949d1170a",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1632,
        -848
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "f73bb7a8-7d3a-4334-8bda-b7e15d90cd40",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -48,
        -848
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "f208e594-4afd-4dfd-a5ce-4c34a7891b34",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        512,
        -848
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "b5704a52-2032-4f8c-97b8-fc1b758065f6",
      "name": "Send Notification",
      "type": "n8n-nodes-base.telegram",
      "position": [
        64,
        -224
      ]
    },
    {
      "id": "741be234-6dca-4a98-b931-808d1d8ad32e",
      "name": "Send Notification image not valid",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1616,
        128
      ]
    },
    {
      "id": "7e1f9c61-2130-4390-85f2-5bdd27e8767c",
      "name": "Send notification duplicate",
      "type": "n8n-nodes-base.telegram",
      "position": [
        2096,
        -80
      ]
    },
    {
      "id": "16d68a8c-60ef-436e-89a6-af22fe57a918",
      "name": "Telegram get file",
      "type": "n8n-nodes-base.telegram",
      "position": [
        240,
        -48
      ]
    },
    {
      "id": "0fdb8423-d76a-4561-b832-45aed67b683c",
      "name": "JSON output parsing",
      "type": "n8n-nodes-base.set",
      "position": [
        960,
        -48
      ]
    },
    {
      "id": "71f1d4a1-3bf6-4030-9d78-1d52775c71bd",
      "name": "Send confirmation message",
      "type": "n8n-nodes-base.telegram",
      "position": [
        2096,
        256
      ]
    },
    {
      "id": "a3576579-cb15-4324-8920-b3787ed336b6",
      "name": "Parse receipt data with AI",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        624,
        -48
      ]
    },
    {
      "id": "b07deb69-9ce2-4015-8771-14a5802d6148",
      "name": "Extract Telegram chat and file ID",
      "type": "n8n-nodes-base.set",
      "position": [
        -352,
        -208
      ]
    },
    {
      "id": "adb93c83-4894-4b95-a58a-9c7d83b01bd7",
      "name": "Check if image was uploaded",
      "type": "n8n-nodes-base.if",
      "position": [
        -144,
        -208
      ]
    },
    {
      "id": "102aaa27-07a3-4021-96b2-0cc39dc2bbfe",
      "name": "Validate required transaction fields",
      "type": "n8n-nodes-base.if",
      "position": [
        1360,
        -48
      ]
    },
    {
      "id": "87ecde57-e303-4a87-a71f-e04a33cc29df",
      "name": "Check for duplicate transaction",
      "type": "n8n-nodes-base.if",
      "position": [
        1824,
        -64
      ]
    },
    {
      "id": "feb8c68e-5132-4949-8b49-2bbb85e348c8",
      "name": "Normalize transaction data",
      "type": "n8n-nodes-base.set",
      "position": [
        1168,
        -48
      ]
    },
    {
      "id": "70ddd1c8-c268-4e07-b6db-fcf16e1fc2f4",
      "name": "Check existing transaction in Excel",
      "type": "n8n-nodes-base.microsoftExcel",
      "position": [
        1616,
        -64
      ]
    },
    {
      "id": "276fcaca-0320-4167-b20f-ebf34944cef3",
      "name": "Save transaction to Excel",
      "type": "n8n-nodes-base.microsoftExcel",
      "position": [
        2096,
        96
      ]
    },
    {
      "id": "76e71511-5fd0-48e3-b413-c872e2b58fda",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -608,
        -848
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "984ad9dc-a337-4d44-98da-45d91f8da683",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        592,
        -144
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "74153927-8fb0-4729-aeb2-a78fa61cde5f",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2000,
        -224
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    }
  ],
  "connections": {
    "Tesseract OCR": {
      "main": [
        [
          {
            "node": "Parse receipt data with AI",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Telegram Trigger": {
      "main": [
        [
          {
            "node": "Extract Telegram chat and file ID",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Parse receipt data with AI",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Telegram get file": {
      "main": [
        [
          {
            "node": "Tesseract OCR",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Configurations": {
      "main": [
        [
          {
            "node": "Normalize transaction data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "JSON output parsing": {
      "main": [
        [
          {
            "node": "Normalize transaction data",
            "type": "main",
            "index": 0
          },
          {
            "node": "Get Configurations",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Save transaction to Excel": {
      "main": [
        []
      ]
    },
    "Send confirmation message": {
      "main": [
        []
      ]
    },
    "Normalize transaction data": {
      "main": [
        [
          {
            "node": "Validate required transaction fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse receipt data with AI": {
      "main": [
        [
          {
            "node": "JSON output parsing",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check if image was uploaded": {
      "main": [
        [
          {
            "node": "Send Notification",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Telegram get file",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check for duplicate transaction": {
      "main": [
        [
          {
            "node": "Send notification duplicate",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Save transaction to Excel",
            "type": "main",
            "index": 0
          },
          {
            "node": "Send confirmation message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Telegram chat and file ID": {
      "main": [
        [
          {
            "node": "Check if image was uploaded",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check existing transaction in Excel": {
      "main": [
        [
          {
            "node": "Check for duplicate transaction",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Validate required transaction fields": {
      "main": [
        [
          {
            "node": "Check existing transaction in Excel",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send Notification image not valid",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}