{
  "name": "Personal finance tracker with Telegram Bot, Google Gemini Vision, and Sheets",
  "nodes": [
    {
      "id": "c6e24869-d9a4-4d62-99cc-3e39b9fd63df",
      "name": "Telegram Trigger",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        1600,
        1072
      ]
    },
    {
      "id": "0f25c4e9-a057-4b51-8f60-84f3403b5f47",
      "name": "Aggregate1",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        3536,
        1264
      ]
    },
    {
      "id": "72c6e90c-8ccc-42ca-a7ea-c30151291739",
      "name": "Extract from File",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        2864,
        1552
      ]
    },
    {
      "id": "66ce05ba-0377-4093-92d8-d2e4cd3d93c1",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        4448,
        1216
      ]
    },
    {
      "id": "14851a75-04cc-4073-abbe-26a97a84afbe",
      "name": "Google Gemini Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        4272,
        1440
      ]
    },
    {
      "id": "471df243-b318-4067-9986-7ba73093857e",
      "name": "Simple Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        4400,
        1440
      ]
    },
    {
      "id": "eee55184-66f8-43b0-880d-9f9e2f452bba",
      "name": "Structured Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        4784,
        1440
      ]
    },
    {
      "id": "6e62a277-53f4-48de-ae84-41eade4c000a",
      "name": "Calculator",
      "type": "@n8n/n8n-nodes-langchain.toolCalculator",
      "position": [
        4528,
        1440
      ]
    },
    {
      "id": "1548a894-b4c7-4327-b645-76bc913760b8",
      "name": "Switch",
      "type": "n8n-nodes-base.switch",
      "position": [
        1824,
        1056
      ]
    },
    {
      "id": "a5d2b46c-9fa4-44e9-9784-1a236d679696",
      "name": "Get a file1",
      "type": "n8n-nodes-base.telegram",
      "position": [
        2224,
        1072
      ]
    },
    {
      "id": "525bfeb1-9480-47a2-9be7-eb15749cf376",
      "name": "Get a file2",
      "type": "n8n-nodes-base.telegram",
      "position": [
        2640,
        1456
      ]
    },
    {
      "id": "9d341f5c-5cc7-47f3-85bb-44a8257a5504",
      "name": "Append row in sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        4992,
        1216
      ]
    },
    {
      "id": "fb639227-827f-49a8-b4fb-04ee8be9316f",
      "name": "Send a text message",
      "type": "n8n-nodes-base.telegram",
      "position": [
        5216,
        1216
      ]
    },
    {
      "id": "3fe82c55-c6de-4cf6-a2d5-89c82bdb1a30",
      "name": "Code in JavaScript",
      "type": "n8n-nodes-base.code",
      "position": [
        2640,
        1072
      ]
    },
    {
      "id": "0a7aee0f-b24c-4694-b954-72f22f495af4",
      "name": "Get row(s) in sheet in Google Sheets",
      "type": "n8n-nodes-base.googleSheetsTool",
      "position": [
        4656,
        1440
      ]
    },
    {
      "id": "173e8433-b6a4-4cbc-8c39-9f428fbff9f9",
      "name": "Upload file",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        2864,
        976
      ]
    },
    {
      "id": "12a33412-4c43-4081-b543-8b8eb4dc159d",
      "name": "Upload file1",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        2864,
        1360
      ]
    },
    {
      "id": "d7f55735-bec7-4ea8-8537-ba9e2e9580d8",
      "name": "Merge1",
      "type": "n8n-nodes-base.merge",
      "position": [
        3088,
        1456
      ]
    },
    {
      "id": "458e8a34-3299-4b21-a7b6-2dd495f5044f",
      "name": "Analyze an image",
      "type": "@n8n/n8n-nodes-langchain.googleGemini",
      "position": [
        2864,
        1168
      ]
    },
    {
      "id": "29e49d4d-621a-4786-b48f-62a39f2d9060",
      "name": "Merge",
      "type": "n8n-nodes-base.merge",
      "position": [
        3088,
        1072
      ]
    },
    {
      "id": "a0fb83c3-3415-40cf-b9f3-fe74fd6422b5",
      "name": "If",
      "type": "n8n-nodes-base.if",
      "position": [
        3312,
        1264
      ]
    },
    {
      "id": "75df2f47-e48b-45fb-91c5-1e6006da5ea9",
      "name": "AI Agent1",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        2768,
        -64
      ]
    },
    {
      "id": "936d3341-d3b9-4e16-b179-1166e6de0a58",
      "name": "Simple Memory1",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        2768,
        160
      ]
    },
    {
      "id": "79930277-57fc-40b4-9a99-1ffa4975b558",
      "name": "Calculator1",
      "type": "@n8n/n8n-nodes-langchain.toolCalculator",
      "position": [
        2896,
        160
      ]
    },
    {
      "id": "1319c5bd-57c1-4608-bc1b-f6a258aba613",
      "name": "Send a text message1",
      "type": "n8n-nodes-base.telegram",
      "position": [
        3232,
        48
      ]
    },
    {
      "id": "389c6950-6986-4069-a2cf-7ab330b66cc1",
      "name": "Get row(s) in sheet in Google Sheets1",
      "type": "n8n-nodes-base.googleSheetsTool",
      "position": [
        3024,
        160
      ]
    },
    {
      "id": "475cdf62-f8f8-4a3c-80ee-f316362c5ba1",
      "name": "Google Gemini Chat Model1",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        2640,
        160
      ]
    },
    {
      "id": "e79874c0-bd63-40e8-a657-24dcdddbc4e7",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1392,
        928
      ],
      "parameters": {
        "width": 768,
        "height": 592,
        "content": "# Trigger/ start workflow\n\nThis is where the workflow begins with a telegram node\n\nthen a switch node that would determine if the input form telegram is an image, text or pdf "
      }
    },
    {
      "id": "794d37c8-f403-4386-b922-2acc0fa3f288",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2480,
        736
      ],
      "parameters": {
        "width": 1184,
        "height": 1056,
        "content": "# Sorting, extracting and OCR\n\n_Here images are OCRed with Gemini model or any model of your choice \n_ PDF are extracted with the extract with the native extract form PDF node\n_ Everything is aggregat"
      }
    },
    {
      "id": "fa5a7d4c-e61f-48b9-85fb-1eddb9ddec7b",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2608,
        -256
      ],
      "parameters": {
        "width": 880,
        "height": 656,
        "content": "# Process text Enquires \n\nThis section processes financial questions, advice and information about financial spend, the Gemini model has access to your excel sheet, a simple memory and calculator to a"
      }
    },
    {
      "id": "9cac23c2-a32e-491d-ba93-fdb7a34c615a",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        4224,
        1040
      ],
      "parameters": {
        "width": 1280,
        "height": 672,
        "content": "# Invoice Processing\n   The agent processes the information form the invoice and then appends to your excel sheet"
      }
    },
    {
      "id": "31d1a7dc-3663-42b0-a888-6b0efb03895f",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        368,
        240
      ],
      "parameters": {
        "width": 688,
        "height": 992,
        "content": "# Personal Finance Telegram Bot: Automated Receipt Tracking & Expense Queries\n\nThis workflow turns your Telegram bot into a smart personal finance assistant. Send receipt photos/PDFs or text, and AI ("
      }
    }
  ],
  "connections": {
    "If": {
      "main": [
        [
          {
            "node": "Aggregate1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Aggregate1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge1": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Switch": {
      "main": [
        [
          {
            "node": "Get a file1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Get a file2",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "AI Agent1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent": {
      "main": [
        [
          {
            "node": "Append row in sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent1": {
      "main": [
        [
          {
            "node": "Send a text message1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate1": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Calculator": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Calculator1": {
      "ai_tool": [
        [
          {
            "node": "AI Agent1",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Get a file1": {
      "main": [
        [
          {
            "node": "Code in JavaScript",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get a file2": {
      "main": [
        [
          {
            "node": "Upload file1",
            "type": "main",
            "index": 0
          },
          {
            "node": "Extract from File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload file": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload file1": {
      "main": [
        [
          {
            "node": "Merge1",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory1": {
      "ai_memory": [
        [
          {
            "node": "AI Agent1",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Analyze an image": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Telegram Trigger": {
      "main": [
        [
          {
            "node": "Switch",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract from File": {
      "main": [
        [
          {
            "node": "Merge1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code in JavaScript": {
      "main": [
        [
          {
            "node": "Upload file",
            "type": "main",
            "index": 0
          },
          {
            "node": "Analyze an image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Append row in sheet": {
      "main": [
        [
          {
            "node": "Send a text message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send a text message": {
      "main": [
        []
      ]
    },
    "Send a text message1": {
      "main": [
        []
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "AI Agent",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent1",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Get row(s) in sheet in Google Sheets": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Get row(s) in sheet in Google Sheets1": {
      "ai_tool": [
        [
          {
            "node": "AI Agent1",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    }
  }
}