Telegram-Chatbot, der Gemini Pro KI und Google Docs integriert, bauen

Fortgeschritten

Dies ist ein Support Chatbot, AI Chatbot, Multimodal AI-Bereich Automatisierungsworkflow mit 9 Nodes. Hauptsächlich werden Wait, Telegram, GoogleDocsTool, SplitInBatches, HttpRequestTool und andere Nodes verwendet. Telegram-Chatbot mit integriertem Gemini Pro AI und Google Docs bauen

Voraussetzungen
  • Telegram Bot Token
  • Möglicherweise sind Ziel-API-Anmeldedaten erforderlich
Workflow-Vorschau
Visualisierung der Node-Verbindungen, mit Zoom und Pan
Workflow exportieren
Kopieren Sie die folgende JSON-Konfiguration und importieren Sie sie in n8n
{
  "meta": {
    "instanceId": "cb9a1e5321767b6316634728341237e564b2587ab15b74ca0a89eb02a53484d6",
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "17ac7115-a306-40bf-8b4a-9ce66ebbe3f1",
      "name": "Ein Modell abfragen",
      "type": "@n8n/n8n-nodes-langchain.googleGemini",
      "position": [
        4800,
        1232
      ],
      "parameters": {
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "models/gemini-2.5-pro",
          "cachedResultName": "models/gemini-2.5-pro"
        },
        "options": {},
        "messages": {
          "values": [
            {
              "content": "Replay test write user-friendly."
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "fbd4e562-fb5a-4e85-9814-75e4a9df2900",
      "name": "Eine Textnachricht senden",
      "type": "n8n-nodes-base.telegram",
      "position": [
        5216,
        1232
      ],
      "webhookId": "3111e55e-41d3-4e3b-863c-bfda700bba92",
      "parameters": {
        "text": "={{ $json.content.parts[0].text }}",
        "chatId": "={{ $('Telegram Trigger').item.json.message.from.id }}",
        "replyMarkup": "replyKeyboard",
        "additionalFields": {},
        "replyKeyboardOptions": {}
      },
      "typeVersion": 1.2
    },
    {
      "id": "98b5b120-ab55-47b2-8f0d-0bc29b32bb7f",
      "name": "Ein Dokument in Google Docs abrufen",
      "type": "n8n-nodes-base.googleDocsTool",
      "position": [
        5184,
        1488
      ],
      "parameters": {
        "simple": false,
        "operation": "get",
        "documentURL": "https://docs.google.com/document/d/19vaCViYaFkjFM6azAMf6fH6tDL2cwSsjTE5vX3eK6Ss"
      },
      "typeVersion": 2
    },
    {
      "id": "c3df74b4-6077-4383-9c23-2f7505cea1fe",
      "name": "Telegram Trigger",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        4224,
        1216
      ],
      "webhookId": "05fcff6f-5e32-4599-9b29-c585878352d8",
      "parameters": {
        "updates": [
          "message"
        ],
        "additionalFields": {}
      },
      "typeVersion": 1.2
    },
    {
      "id": "41eee1be-dfb9-4e7d-b659-a9de0e740e7a",
      "name": "1 Sekunde warten",
      "type": "n8n-nodes-base.wait",
      "position": [
        5488,
        1232
      ],
      "webhookId": "8223d68f-b3b2-4c42-a6d2-473a19e2904c",
      "parameters": {
        "amount": 1
      },
      "typeVersion": 1.1
    },
    {
      "id": "3dc90867-9946-4143-aeb9-a096993486c5",
      "name": "Ein Modell in Google Gemini abfragen",
      "type": "@n8n/n8n-nodes-langchain.googleGeminiTool",
      "position": [
        4992,
        1488
      ],
      "parameters": {
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "models/gemini-2.0-flash-exp",
          "cachedResultName": "models/gemini-2.0-flash-exp"
        },
        "options": {},
        "messages": {
          "values": [
            {
              "content": "Replay test write user-friendly."
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "0049c3fc-f6a2-420f-b0ca-c7330021a405",
      "name": "HTTP Request",
      "type": "n8n-nodes-base.httpRequestTool",
      "position": [
        4768,
        1488
      ],
      "parameters": {
        "url": "https://devcodejourney.com/",
        "options": {},
        "toolDescription": "Replay test write user-friendly."
      },
      "typeVersion": 4.2
    },
    {
      "id": "162fb82a-9ced-401a-a67e-6c4d3b84d118",
      "name": "Notizzettel",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2544,
        1184
      ],
      "parameters": {
        "width": 1552,
        "height": 2352,
        "content": "# 🤖 Telegram + Gemini + Google Docs Automation in n8n\n\n## 📌 Overview\n\nThis n8n workflow listens for messages sent to a Telegram bot and replies with AI-generated responses using **Google Gemini (PaLM)**. It optionally interacts with **Google Docs** to fetch documents and makes external API requests using an **HTTP Request** node.\n\nThe flow also includes batching and waiting logic to control the pace of replies, making it scalable and human-friendly.\n\n---\n\n## 🧠 What This Workflow Does\n\n### ✅ 1. Trigger from Telegram\n- **Node**: `Telegram Trigger`\n- **Function**: Starts the workflow when a message is received via your Telegram bot.\n\n### ✅ 2. Loop Through Messages\n- **Node**: `Loop Over Items`\n- **Function**: Allows processing multiple incoming messages if required, using batching logic.\n\n### ✅ 3. AI-Powered Reply with Gemini\n- **Node**: `Message a model` (Google Gemini Pro)\n- **Function**: Sends the message to the Gemini AI (via Google PaLM API) to generate a human-friendly, conversational response.\n\n### ✅ 4. Send AI Response via Telegram\n- **Node**: `Send a text message`\n- **Function**: Sends the generated Gemini response back to the user on Telegram.\n\n### ✅ 5. Delay Between Replies\n- **Node**: `Wait 1s`\n- **Function**: Adds a 1-second delay before proceeding to the next message in the loop (helps avoid Telegram rate limits and creates more natural pacing).\n\n### ✅ 6. Optional: External API Request\n- **Node**: `HTTP Request`\n- **Function**: Makes an external API request to `https://devcodejourney.com/` (placeholder URL).\n- **Note**: Currently not connected to message flow but can be used to fetch or send additional data.\n\n### ✅ 7. Optional: Fetch Document from Google Docs\n- **Node**: `Get a document in Google Docs`\n- **Function**: Retrieves the contents of a Google Docs document from a provided link. Can be used to add static text, FAQs, or templates to the conversation.\n\n### ✅ 8. Optional: Alternate Gemini Tool\n- **Node**: `Message a model in Google Gemini`\n- **Function**: Uses a different version (`gemini-2.0-flash-exp`) of the Gemini AI model for fast responses or testing purposes.\n\n---\n\n## 🔧 Technologies Used\n\n- **Telegram Bot API** – for message triggers and replies  \n- **Google Gemini (PaLM API)** – for AI-generated responses  \n- **Google Docs API** – to fetch document content  \n- **HTTP Request** – to connect to any third-party API  \n- **n8n** – no-code/low-code workflow automation platform  \n\n---\n\n## ⚙️ Use Cases\n\n- AI Chatbot for Telegram using Gemini  \n- Personal Assistant or FAQ bot reading from Google Docs  \n- Customer service bot that replies in natural language  \n- Looping conversations with controlled pacing  \n- External data fetching with AI processing  \n\n---\n\n## 📌 Notes\n\n- Make sure you have the correct credentials configured in n8n for:\n  - Telegram Bot\n  - Google Docs OAuth2\n  - Google Gemini API (PaLM)\n- You can add error-handling nodes or conditionals to expand the logic.\n- This can be extended into a full AI chatbot or customer support bot.\n\n---\n\n## 🧩 Nodes Used\n\n| Node Name                          | Type                       | Purpose                                 |\n|-----------------------------------|----------------------------|-----------------------------------------|\n| Telegram Trigger                  | telegramTrigger            | Listens for incoming Telegram messages  |\n| Loop Over Items                   | splitInBatches             | Handles batching of incoming data       |\n| Message a model                   | langchain.googleGemini     | Sends prompt to Google Gemini (Pro)     |\n| Send a text message               | telegram                   | Sends response back to Telegram user    |\n| Wait 1s                           | wait                        | Adds a delay between responses          |\n| HTTP Request                      | httpRequestTool            | Sends HTTP request to external API      |\n| Get a document in Google Docs     | googleDocsTool             | Fetches content from Google Docs        |\n| Message a model in Google Gemini | googleGeminiTool           | Alternate Gemini model for responses    |\n\n---\n"
      },
      "typeVersion": 1
    },
    {
      "id": "9c16c31f-95db-40ab-aa8d-37750b123d2a",
      "name": "Über Elemente iterieren1",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        4480,
        1216
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    }
  ],
  "pinData": {},
  "connections": {
    "41eee1be-dfb9-4e7d-b659-a9de0e740e7a": {
      "main": [
        [
          {
            "node": "9c16c31f-95db-40ab-aa8d-37750b123d2a",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "0049c3fc-f6a2-420f-b0ca-c7330021a405": {
      "ai_tool": [
        [
          {
            "node": "17ac7115-a306-40bf-8b4a-9ce66ebbe3f1",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "17ac7115-a306-40bf-8b4a-9ce66ebbe3f1": {
      "main": [
        [
          {
            "node": "fbd4e562-fb5a-4e85-9814-75e4a9df2900",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "9c16c31f-95db-40ab-aa8d-37750b123d2a": {
      "main": [
        [],
        [
          {
            "node": "17ac7115-a306-40bf-8b4a-9ce66ebbe3f1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "c3df74b4-6077-4383-9c23-2f7505cea1fe": {
      "main": [
        [
          {
            "node": "9c16c31f-95db-40ab-aa8d-37750b123d2a",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "fbd4e562-fb5a-4e85-9814-75e4a9df2900": {
      "main": [
        [
          {
            "node": "41eee1be-dfb9-4e7d-b659-a9de0e740e7a",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "98b5b120-ab55-47b2-8f0d-0bc29b32bb7f": {
      "ai_tool": [
        [
          {
            "node": "17ac7115-a306-40bf-8b4a-9ce66ebbe3f1",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "3dc90867-9946-4143-aeb9-a096993486c5": {
      "ai_tool": [
        [
          {
            "node": "17ac7115-a306-40bf-8b4a-9ce66ebbe3f1",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    }
  }
}
Häufig gestellte Fragen

Wie verwende ich diesen Workflow?

Kopieren Sie den obigen JSON-Code, erstellen Sie einen neuen Workflow in Ihrer n8n-Instanz und wählen Sie "Aus JSON importieren". Fügen Sie die Konfiguration ein und passen Sie die Anmeldedaten nach Bedarf an.

Für welche Szenarien ist dieser Workflow geeignet?

Fortgeschritten - Support-Chatbot, KI-Chatbot, Multimodales KI

Ist es kostenpflichtig?

Dieser Workflow ist völlig kostenlos. Beachten Sie jedoch, dass Drittanbieterdienste (wie OpenAI API), die im Workflow verwendet werden, möglicherweise kostenpflichtig sind.

Workflow-Informationen
Schwierigkeitsgrad
Fortgeschritten
Anzahl der Nodes9
Kategorie3
Node-Typen9
Schwierigkeitsbeschreibung

Für erfahrene Benutzer, mittelkomplexe Workflows mit 6-15 Nodes

Autor
DevCode Journey

DevCode Journey

@devcodejourney

I build intelligent systems that automate tasks, streamline workflows, and enhance user experiences using tools like n8n, AI chatbots, and modern automation platforms. With a passion for solving real-world problems through smart technology, I create custom solutions that help individuals and businesses save time, scale faster, and work smarter. Whether it's integrating APIs, building no-code/low-code automations, or developing conversational AI, I'm always exploring the edge of what's possible.

Externe Links
Auf n8n.io ansehen

Diesen Workflow teilen

Kategorien

Kategorien: 34