{
  "name": "Extract & store receipt data with GPT-4, OCR, Google Sheets & Notion via Telegram Bot",
  "nodes": [
    {
      "id": "1ab8188b-b92f-4e84-9d49-1baf01e999cc",
      "name": "Telegram Bot Trigger",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        -512,
        160
      ]
    },
    {
      "id": "50cecf34-87c8-4fa6-9599-30f656a4b593",
      "name": "Message Type Router",
      "type": "n8n-nodes-base.switch",
      "position": [
        -272,
        160
      ]
    },
    {
      "id": "32cc964e-d4b2-4072-b3d2-3d41c3f2925f",
      "name": "Download Telegram Image",
      "type": "n8n-nodes-base.telegram",
      "position": [
        0,
        0
      ]
    },
    {
      "id": "e4c88939-58a3-4dea-b754-d6e542edd530",
      "name": "OCR Receipt Processing",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        176,
        80
      ]
    },
    {
      "id": "3ae3a207-260f-440f-a06d-956aeb675244",
      "name": "Handle Text Message",
      "type": "n8n-nodes-base.function",
      "position": [
        0,
        272
      ]
    },
    {
      "id": "0d04b8c2-27c7-45a4-9175-43705b0bf9cd",
      "name": "AI Purchase Data Extractor",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        320,
        208
      ]
    },
    {
      "id": "ff76dcfc-40d3-469b-9308-7dec5dcfe4a2",
      "name": "Transaction Data Validator",
      "type": "n8n-nodes-base.function",
      "position": [
        608,
        176
      ]
    },
    {
      "id": "7c57c8da-7156-48d2-936c-33f33c31f797",
      "name": "Check for Errors",
      "type": "n8n-nodes-base.switch",
      "position": [
        800,
        176
      ]
    },
    {
      "id": "06af3c07-0613-4990-95ae-2395aeda7725",
      "name": "Send Error Message",
      "type": "n8n-nodes-base.telegram",
      "position": [
        960,
        176
      ]
    },
    {
      "id": "9fb86db3-19dd-4dab-9309-69151fffd0d1",
      "name": "Record to Database",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1184,
        96
      ]
    },
    {
      "id": "181ea179-c278-422a-934e-4d5ec899ba3f",
      "name": "Store Receipt Image",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        1184,
        -32
      ]
    },
    {
      "id": "4249d4f3-e394-4d03-9ee9-d608ba94082f",
      "name": "Save to Notion Database",
      "type": "n8n-nodes-base.notion",
      "position": [
        1184,
        240
      ]
    },
    {
      "id": "96f32d63-a79b-4154-a223-76d00336f76e",
      "name": "Send to Website API",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1248,
        384
      ]
    },
    {
      "id": "c4e931b6-5988-4cd4-ae38-48650d523213",
      "name": "Send Confirmation",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1424,
        176
      ]
    }
  ],
  "connections": {
    "Check for Errors": {
      "main": [
        [
          {
            "node": "Send Error Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Record to Database": {
      "main": [
        [
          {
            "node": "Send Confirmation",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Error Message": {
      "main": [
        [
          {
            "node": "Save to Notion Database",
            "type": "main",
            "index": 0
          },
          {
            "node": "Send to Website API",
            "type": "main",
            "index": 0
          },
          {
            "node": "Record to Database",
            "type": "main",
            "index": 0
          },
          {
            "node": "Store Receipt Image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Handle Text Message": {
      "main": [
        [
          {
            "node": "AI Purchase Data Extractor",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Message Type Router": {
      "main": [
        [
          {
            "node": "Download Telegram Image",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Handle Text Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send to Website API": {
      "main": [
        [
          {
            "node": "Send Confirmation",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Store Receipt Image": {
      "main": [
        [
          {
            "node": "Send Confirmation",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Telegram Bot Trigger": {
      "main": [
        [
          {
            "node": "Message Type Router",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OCR Receipt Processing": {
      "main": [
        [
          {
            "node": "AI Purchase Data Extractor",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download Telegram Image": {
      "main": [
        [
          {
            "node": "OCR Receipt Processing",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Save to Notion Database": {
      "main": [
        [
          {
            "node": "Send Confirmation",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Purchase Data Extractor": {
      "main": [
        [
          {
            "node": "Transaction Data Validator",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Transaction Data Validator": {
      "main": [
        [
          {
            "node": "Check for Errors",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}