{
  "name": "Track expenses and income in Google Sheets from Telegram with Google Gemini",
  "nodes": [
    {
      "id": "telegram-trigger",
      "name": "Telegram Trigger",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        16,
        1280
      ]
    },
    {
      "id": "typing",
      "name": "Typing...",
      "type": "n8n-nodes-base.telegram",
      "position": [
        272,
        1152
      ]
    },
    {
      "id": "ai-agent",
      "name": "AI Agent - Expense Tracker",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        480,
        1280
      ]
    },
    {
      "id": "gemini-model",
      "name": "Google Gemini Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        80,
        1520
      ]
    },
    {
      "id": "memory",
      "name": "Simple Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        224,
        1520
      ]
    },
    {
      "id": "add-expense",
      "name": "add_expense",
      "type": "n8n-nodes-base.googleSheetsTool",
      "position": [
        352,
        1520
      ]
    },
    {
      "id": "get-expense",
      "name": "get_expense",
      "type": "n8n-nodes-base.googleSheetsTool",
      "position": [
        464,
        1520
      ]
    },
    {
      "id": "delete-expense",
      "name": "delete_expense",
      "type": "n8n-nodes-base.googleSheetsTool",
      "position": [
        592,
        1520
      ]
    },
    {
      "id": "add-income",
      "name": "add_income",
      "type": "n8n-nodes-base.googleSheetsTool",
      "position": [
        720,
        1520
      ]
    },
    {
      "id": "get-income",
      "name": "get_income",
      "type": "n8n-nodes-base.googleSheetsTool",
      "position": [
        848,
        1520
      ]
    },
    {
      "id": "calculator",
      "name": "Calculator",
      "type": "@n8n/n8n-nodes-langchain.toolCalculator",
      "position": [
        960,
        1520
      ]
    },
    {
      "id": "think",
      "name": "Think",
      "type": "@n8n/n8n-nodes-langchain.toolThink",
      "position": [
        1072,
        1520
      ]
    },
    {
      "id": "markdown-formatter",
      "name": "Markdown to HTML Formatter",
      "type": "n8n-nodes-base.code",
      "position": [
        832,
        1104
      ]
    },
    {
      "id": "send-message",
      "name": "Send Telegram Message",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1040,
        1104
      ]
    },
    {
      "id": "send-error",
      "name": "Send Error Message",
      "type": "n8n-nodes-base.telegram",
      "position": [
        832,
        1296
      ]
    },
    {
      "id": "sticky_prereq",
      "name": "📋 Prerequisites",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -720,
        -128
      ],
      "parameters": {
        "width": 720,
        "height": 1280,
        "content": "📋 PREREQUISITES\n\nBefore using this workflow, ensure you have:\n\n① Google Account\n• Access to Google Sheets\n• OAuth2 credentials from Google Cloud Console\n\n② Telegram Bot\n• Create bot via @BotFather\n• S"
      }
    },
    {
      "id": "sticky_config",
      "name": "⚙️ Configuration",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        32,
        -128
      ],
      "parameters": {
        "width": 768,
        "height": 592,
        "content": "⚙️ CONFIGURATION\n\nStep 1 — Create Credentials\nGo to Settings → Credentials:\n\n|Credential | Type | Source |\n|---|---|---|\n| Telegram API | Bot Token | @BotFather |\n| Google Sheets | OAuth2 | Google Clo"
      }
    },
    {
      "id": "sticky_info",
      "name": "💡 Important Info",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        32,
        480
      ],
      "parameters": {
        "width": 768,
        "height": 672,
        "content": "💡 HOW IT WORKS\n\nThis is a Telegram-based AI expense tracker.\nSend natural language and AI will:\n✓ Log expenses & income to Google Sheets\n✓ Auto-categorize transactions\n✓ Calculate totals and summaries"
      }
    }
  ],
  "connections": {
    "Think": {
      "ai_tool": [
        [
          {
            "node": "AI Agent - Expense Tracker",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Calculator": {
      "ai_tool": [
        [
          {
            "node": "AI Agent - Expense Tracker",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "add_income": {
      "ai_tool": [
        [
          {
            "node": "AI Agent - Expense Tracker",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "get_income": {
      "ai_tool": [
        [
          {
            "node": "AI Agent - Expense Tracker",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "add_expense": {
      "ai_tool": [
        [
          {
            "node": "AI Agent - Expense Tracker",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "get_expense": {
      "ai_tool": [
        [
          {
            "node": "AI Agent - Expense Tracker",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent - Expense Tracker",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "delete_expense": {
      "ai_tool": [
        [
          {
            "node": "AI Agent - Expense Tracker",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Telegram Trigger": {
      "main": [
        [
          {
            "node": "Typing...",
            "type": "main",
            "index": 0
          },
          {
            "node": "AI Agent - Expense Tracker",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent - Expense Tracker",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent - Expense Tracker": {
      "main": [
        [
          {
            "node": "Markdown to HTML Formatter",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send Error Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Markdown to HTML Formatter": {
      "main": [
        [
          {
            "node": "Send Telegram Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}