{
  "name": "Telegram to Google Drive: auto upload & track videos with Gemini AI assistant",
  "nodes": [
    {
      "id": "2eb46252-42bf-4db6-996b-aa5fb523dbdc",
      "name": "Upload file1",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        176,
        -1072
      ]
    },
    {
      "id": "09050f3a-9c99-48b7-8064-b5e51a8d79d7",
      "name": "Get a file1",
      "type": "n8n-nodes-base.telegram",
      "position": [
        -16,
        -1072
      ]
    },
    {
      "id": "04673879-5c55-4ca5-9a04-e6d24dbda5fb",
      "name": "Append row in sheet1",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        400,
        -1072
      ]
    },
    {
      "id": "980a5b64-69a4-464d-b31c-01cf791c1181",
      "name": "Send a text message3",
      "type": "n8n-nodes-base.telegram",
      "position": [
        624,
        -1072
      ]
    },
    {
      "id": "c74de640-ad29-4c01-8056-780491ea3dac",
      "name": "Switch1",
      "type": "n8n-nodes-base.switch",
      "position": [
        -384,
        -240
      ]
    },
    {
      "id": "ec529d29-81b5-4a26-a414-2f62a830439a",
      "name": "Update file1",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        176,
        -272
      ]
    },
    {
      "id": "02c2fb3a-7090-4850-8747-f9856a1d2861",
      "name": "Code1",
      "type": "n8n-nodes-base.code",
      "position": [
        -16,
        -272
      ]
    },
    {
      "id": "ff864633-ac91-4e09-bc0c-060dff00c2f2",
      "name": "Update row in sheet1",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        400,
        -272
      ]
    },
    {
      "id": "e1671455-e214-4b89-be35-e235f3f68211",
      "name": "Send a text message4",
      "type": "n8n-nodes-base.telegram",
      "position": [
        624,
        -272
      ]
    },
    {
      "id": "97c22a46-cef9-43ec-ba02-bbf1eb9babaa",
      "name": "AI Agent1",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        80,
        400
      ]
    },
    {
      "id": "804880c6-b9ff-483f-9efd-b57023006b43",
      "name": "Google Gemini Chat Model1",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        16,
        624
      ]
    },
    {
      "id": "e4c909f6-6e9b-49ac-98fb-d8a1b49daa5b",
      "name": "Simple Memory1",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        144,
        624
      ]
    },
    {
      "id": "0096ecc7-dab5-467c-bcae-6456a18ec213",
      "name": "Data Vidio1",
      "type": "n8n-nodes-base.googleSheetsTool",
      "position": [
        272,
        624
      ]
    },
    {
      "id": "733e2d39-bbdf-43d3-9590-a0785c216a1f",
      "name": "Send a text message5",
      "type": "n8n-nodes-base.telegram",
      "position": [
        480,
        400
      ]
    },
    {
      "id": "29536951-6c67-44a6-a791-e383cc0aebb5",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -688,
        -640
      ],
      "parameters": {
        "width": 496,
        "height": 608,
        "content": "## 1. Trigger & Routing\n\nTelegram Trigger → Switch\n\n**Purpose**\n* Detects every incoming message/video from your Telegram bot.\n* The Switch node routes the message into 3 paths:\n\n  * **Video** → autom"
      }
    },
    {
      "id": "11c664ed-a5ed-451d-a636-f8cb482d1ea2",
      "name": "Telegram Trigger",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        -608,
        -224
      ]
    },
    {
      "id": "e94bb294-e4a4-4bea-be6b-7be7dbba904e",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1376,
        -800
      ],
      "parameters": {
        "width": 624,
        "height": 992,
        "content": "## 🚀 Overview\n\nThis workflow automates Telegram-to-Google Drive video uploads with smart renaming, Google Sheets logging, and Gemini AI assistance. Ideal for creators, educators, and automation-focuse"
      }
    },
    {
      "id": "f394d958-0bc9-41cd-9785-e2c296b03e06",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -48,
        -48
      ],
      "parameters": {
        "width": 880,
        "height": 800,
        "content": "## 4. AI Auto-Reply System\n\n**AI Agent → Gemini Model → Memory → Data Sheet → Telegram Reply**\n\n**Purpose**\n\nHandles all non-video and non-/edit text messages through an AI Agent that:\n\n* Has per-user"
      }
    },
    {
      "id": "52f56ef2-7625-444d-8e1f-297fac7002f0",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -48,
        -1680
      ],
      "parameters": {
        "width": 880,
        "height": 768,
        "content": "## 2. Video Upload Process\n\n**Get a file1 → Upload file1 → Append row → Send message**\n\n**Workflow**\n\n1. Get a file1\n   Retrieves the video file from Telegram using `file_id`.\n\n2. Upload file1\n   Auto"
      }
    },
    {
      "id": "ee7bf956-b894-498c-8937-1ebbabc12ed4",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -48,
        -864
      ],
      "parameters": {
        "width": 880,
        "height": 768,
        "content": "## 3. File Rename Process\n\n**Code1 → Update file → Update row → Send message**\n\n**Rename Flow**\n\n1. Code1\n   Parses the `/edit ID new_name` command.\n\n2. Update file1\n   Renames the file in Google Driv"
      }
    }
  ],
  "connections": {
    "Code1": {
      "main": [
        [
          {
            "node": "Update file1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Switch1": {
      "main": [
        [
          {
            "node": "Get a file1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Code1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "AI Agent1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent1": {
      "main": [
        [
          {
            "node": "Send a text message5",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Data Vidio1": {
      "ai_tool": [
        [
          {
            "node": "AI Agent1",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Get a file1": {
      "main": [
        [
          {
            "node": "Upload file1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update file1": {
      "main": [
        [
          {
            "node": "Update row in sheet1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload file1": {
      "main": [
        [
          {
            "node": "Append row in sheet1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory1": {
      "ai_memory": [
        [
          {
            "node": "AI Agent1",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Telegram Trigger": {
      "main": [
        [
          {
            "node": "Switch1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Append row in sheet1": {
      "main": [
        [
          {
            "node": "Send a text message3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update row in sheet1": {
      "main": [
        [
          {
            "node": "Send a text message4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent1",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    }
  }
}