{
  "name": "Process receipts with Google Vision OCR, AI & Telegram to Google Sheets",
  "nodes": [
    {
      "id": "1e4b5f2c-827a-40da-b0b5-cf6405d3d41c",
      "name": "Telegram Trigger",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        -4080,
        -320
      ]
    },
    {
      "id": "4a22cbd2-7888-4098-a9d0-8fc4726ac537",
      "name": "If",
      "type": "n8n-nodes-base.if",
      "position": [
        -3860,
        -320
      ]
    },
    {
      "id": "d895590f-7790-47f1-af15-a18fc8b51492",
      "name": "Get Path",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -3280,
        -440
      ]
    },
    {
      "id": "aa36a70e-f6a5-495c-8ae4-83fe3dc5ea60",
      "name": "Get URL",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -3100,
        -440
      ]
    },
    {
      "id": "ee19459b-b8f0-4e9f-940f-3c165898f744",
      "name": "Set Vision API",
      "type": "n8n-nodes-base.set",
      "position": [
        -2720,
        -440
      ]
    },
    {
      "id": "cf01bb03-cb8d-467b-b6e9-c8f8c3127ac1",
      "name": "HTTP Request",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -2500,
        -440
      ]
    },
    {
      "id": "a8137a20-d135-4bb4-a010-dd77bb390d41",
      "name": "Code",
      "type": "n8n-nodes-base.code",
      "position": [
        -2920,
        -440
      ]
    },
    {
      "id": "b8cc498e-3716-4cd2-8775-11fdbfb2d7f0",
      "name": "Basic LLM Chain",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        -2280,
        -440
      ]
    },
    {
      "id": "1ab8b159-83c8-41c1-a714-c459b2967d05",
      "name": "OpenRouter Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "position": [
        -2280,
        -240
      ]
    },
    {
      "id": "542b2f21-8a8f-4110-b0d1-c02642fe5809",
      "name": "Structured Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        -2120,
        -240
      ]
    },
    {
      "id": "6dd87457-4afd-41ef-b0ee-0ddfff83f94a",
      "name": "Append or update row in sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -1480,
        -440
      ]
    },
    {
      "id": "50783998-dd2e-4597-98e0-6f5e9892d69a",
      "name": "Split Out",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        -1680,
        -440
      ]
    },
    {
      "id": "a15f4030-bf82-439e-84b3-39752d2e9017",
      "name": "Basic LLM Chain1",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        -1920,
        20
      ]
    },
    {
      "id": "e18b01e4-d88f-4b89-aa24-8e1eeaccf70d",
      "name": "OpenRouter Chat Model1",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "position": [
        -1920,
        220
      ]
    },
    {
      "id": "e8754a00-1761-42b6-a768-489e21895044",
      "name": "Send a text message",
      "type": "n8n-nodes-base.telegram",
      "position": [
        -1560,
        20
      ]
    },
    {
      "id": "6d0388c7-5995-463f-95e8-ea2f0ae3f22e",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -3520,
        100
      ]
    },
    {
      "id": "64819421-164f-4b66-8f38-f12f30d67877",
      "name": "Get row(s) in sheet in Google Sheets",
      "type": "n8n-nodes-base.googleSheetsTool",
      "position": [
        -3280,
        320
      ]
    },
    {
      "id": "a4dcf0e8-bfb1-49d1-b198-eb578334accc",
      "name": "OpenRouter Chat Model2",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "position": [
        -3520,
        320
      ]
    },
    {
      "id": "fb81aa66-2d80-42c6-b391-584097b42c02",
      "name": "Send a text message1",
      "type": "n8n-nodes-base.telegram",
      "position": [
        -3180,
        100
      ]
    },
    {
      "id": "d3d431c6-5492-4aa7-a814-eac634407391",
      "name": "Simple Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        -3440,
        320
      ]
    },
    {
      "id": "6e737840-75f2-4ef7-a108-f8a232d60a72",
      "name": "Code1",
      "type": "n8n-nodes-base.code",
      "position": [
        -1920,
        -440
      ]
    },
    {
      "id": "0a96b324-9e24-45e4-99cf-8b2822f91242",
      "name": "Send a text message2",
      "type": "n8n-nodes-base.telegram",
      "position": [
        -2500,
        -620
      ]
    },
    {
      "id": "46f7fdaa-5fe3-49f1-8e1e-9e8cd0ac559a",
      "name": "Set Telegram Token",
      "type": "n8n-nodes-base.set",
      "position": [
        -3520,
        -440
      ]
    },
    {
      "id": "119c9b9d-26cb-4578-bc5f-6ef756fd08c7",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -4720,
        -760
      ],
      "parameters": {
        "width": 580,
        "height": 1020,
        "content": "## Automated Financial Reporting Using Google Vision OCR, Telegram & Google Sheets\n\n\nThis workflow automates the process of recording financial transactions from photos of receipts or shopping receipt"
      }
    },
    {
      "id": "500572a3-af19-4d22-87c2-99a16803ada1",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3580,
        -620
      ],
      "parameters": {
        "width": 220,
        "height": 340,
        "content": "Store the Telegram bot API token as a variable (telegram Token) so that it can be used by subsequent nodes without repeated hardcoding."
      }
    },
    {
      "id": "ea7c2f1c-1667-43c5-a32a-018ee7fa693b",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3300,
        -660
      ],
      "parameters": {
        "width": 500,
        "height": 380,
        "content": "- Retrieves the file path (image) from Telegram by accessing the getFile endpoint. This path is needed so we can download the image file from the Telegram server.\n- After obtaining the file_path, this"
      }
    },
    {
      "id": "41fb4adb-7a5a-418d-a4f6-ee37ccf67ec0",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2760,
        -880
      ],
      "parameters": {
        "width": 400,
        "height": 600,
        "content": "- Save the Google Vision API key into a variable named visionAPI. This variable will later be used to dynamically call the OCR endpoint, without having to specify the API key directly in the URL.\n- Se"
      }
    },
    {
      "id": "c6508f4d-0ad4-4d93-939d-170a322d1f61",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2320,
        -560
      ],
      "parameters": {
        "width": 320,
        "height": 480,
        "content": "Using LLM (Language Model) to process OCR text from Google Vision API (fullTextAnnotation) and convert it into structured data."
      }
    },
    {
      "id": "45b230e7-a528-4568-a834-c14f6c15b492",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1940,
        -640
      ],
      "parameters": {
        "width": 640,
        "height": 380,
        "content": "- Cleans numeric data from characters such as periods or commas (common in receipt pricing formats), then converts them to whole numbers (integers).\n- Splits the Items[] array (containing products per"
      }
    },
    {
      "id": "29c7a276-4ed9-4b44-88eb-5e4bf67f704d",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1940,
        -100
      ],
      "parameters": {
        "width": 640,
        "height": 480,
        "content": "- Converts parsed transaction data into a human readable text summary.\n- Sends the summary results from LLM to Telegram users."
      }
    },
    {
      "id": "87ac24f9-94ef-4a50-935e-a67d2d79a950",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3540,
        0
      ],
      "parameters": {
        "width": 500,
        "height": 480,
        "content": "Providing text based interaction features with users on Telegram, this agent is designed as a financial assistant that answers user questions based on transaction data previously recorded in Google Sh"
      }
    }
  ],
  "connections": {
    "If": {
      "main": [
        [
          {
            "node": "Set Telegram Token",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code": {
      "main": [
        [
          {
            "node": "Set Vision API",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code1": {
      "main": [
        [
          {
            "node": "Split Out",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get URL": {
      "main": [
        [
          {
            "node": "Code",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent": {
      "main": [
        [
          {
            "node": "Send a text message1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Path": {
      "main": [
        [
          {
            "node": "Get URL",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Out": {
      "main": [
        [
          {
            "node": "Append or update row in sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request": {
      "main": [
        [
          {
            "node": "Basic LLM Chain",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Set Vision API": {
      "main": [
        [
          {
            "node": "HTTP Request",
            "type": "main",
            "index": 0
          },
          {
            "node": "Send a text message2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Basic LLM Chain": {
      "main": [
        [
          {
            "node": "Basic LLM Chain1",
            "type": "main",
            "index": 0
          },
          {
            "node": "Code1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Basic LLM Chain1": {
      "main": [
        [
          {
            "node": "Send a text message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Telegram Trigger": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Telegram Token": {
      "main": [
        [
          {
            "node": "Get Path",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenRouter Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Basic LLM Chain",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "OpenRouter Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "Basic LLM Chain1",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "OpenRouter Chat Model2": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Basic LLM Chain",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Get row(s) in sheet in Google Sheets": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    }
  }
}