AutomationFlowsAI & RAG › Gemini Telegram Codebot

Gemini Telegram Codebot

Gemini Telegram CodeBot. Uses telegramTrigger, httpRequest, telegram. Event-driven trigger; 7 nodes.

Event trigger★★★★☆ complexity7 nodesTelegram TriggerHTTP RequestTelegram
AI & RAG Trigger: Event Nodes: 7 Complexity: ★★★★☆ Added:

This workflow follows the HTTP Request → Telegram recipe pattern — see all workflows that pair these two integrations.

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "nodes": [
    {
      "id": "1",
      "name": "Telegram Trigger",
      "type": "n8n-nodes-base.telegramTrigger",
      "typeVersion": 1,
      "position": [
        100,
        200
      ],
      "parameters": {
        "updateTypes": [
          "message"
        ]
      }
    },
    {
      "id": "2",
      "name": "Prepare Gemini Input",
      "type": "n8n-nodes-base.set",
      "typeVersion": 2,
      "position": [
        300,
        200
      ],
      "parameters": {
        "keepOnlySet": true,
        "values": {
          "json": [
            {
              "name": "contents",
              "value": "= [{ \"parts\": [ { \"text\": \"{{$json[\"message\"][\"text\"]}}\" } ] }]"
            }
          ]
        }
      }
    },
    {
      "id": "3",
      "name": "Google Gemini",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 1,
      "position": [
        500,
        200
      ],
      "parameters": {
        "url": "https://generativelanguage.googleapis.com/v1beta/models/gemini-pro:generateContent?key=YOUR_GEMINI_API_KEY",
        "method": "POST",
        "responseFormat": "json",
        "jsonParameters": true,
        "options": {},
        "bodyParametersJson": "={\"contents\": {{$json[\"contents\"]}}",
        "headerParametersJson": "{\"Content-Type\": \"application/json\"}"
      }
    },
    {
      "id": "4",
      "name": "Extract Gemini Response",
      "type": "n8n-nodes-base.function",
      "typeVersion": 1,
      "position": [
        700,
        200
      ],
      "parameters": {
        "functionCode": "const reply = $json[\"candidates\"][0][\"content\"][\"parts\"][0][\"text\"];\nreturn [{ json: { code: reply } }];"
      }
    },
    {
      "id": "5",
      "name": "Send to Hastebin",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 1,
      "position": [
        900,
        200
      ],
      "parameters": {
        "url": "https://hastebin.com/documents",
        "method": "POST",
        "responseFormat": "json",
        "jsonParameters": false,
        "options": {},
        "bodyContentType": "text/plain",
        "bodyContent": "={{$json[\"code\"]}}"
      }
    },
    {
      "id": "6",
      "name": "Format Link for Telegram",
      "type": "n8n-nodes-base.function",
      "typeVersion": 1,
      "position": [
        1100,
        200
      ],
      "parameters": {
        "functionCode": "const key = $json[\"key\"];\nreturn [{ json: { reply: `Here is your code: https://hastebin.com/${key}` } }];"
      }
    },
    {
      "id": "7",
      "name": "Reply via Telegram",
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1,
      "position": [
        1300,
        200
      ],
      "parameters": {
        "chatId": "={{$json[\"chat\"][\"id\"]}}",
        "text": "={{$json[\"reply\"]}}"
      }
    }
  ],
  "connections": {
    "1": {
      "main": [
        [
          {
            "node": "Prepare Gemini Input",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "2": {
      "main": [
        [
          {
            "node": "Google Gemini",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "3": {
      "main": [
        [
          {
            "node": "Extract Gemini Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "4": {
      "main": [
        [
          {
            "node": "Send to Hastebin",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "5": {
      "main": [
        [
          {
            "node": "Format Link for Telegram",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "6": {
      "main": [
        [
          {
            "node": "Reply via Telegram",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "name": "Gemini Telegram CodeBot",
  "active": false
}
Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

Gemini Telegram CodeBot. Uses telegramTrigger, httpRequest, telegram. Event-driven trigger; 7 nodes.

Source: https://gist.github.com/scottagecheeseandcrackers/e505fc1eb9fbb95ee4fdb3ae8e64f54d — original creator credit. Request a take-down →

More AI & RAG workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

AI & RAG

Creators, designers, and developers exploring AI-powered image generation. Automation enthusiasts who want to integrate image creation into n8n workflows. Telegram bot builders looking to add visual A

Telegram Trigger, Airtable, HTTP Request +2
AI & RAG

[](https://www.linkedin.com/in/mosaab-yassir-lafrimi/)[](https://t.me/joevenner)

Telegram Trigger, HTTP Request, Redis +3
AI & RAG

Transcribe audio messages from Telegram using Google Gemini for free.

Telegram, Telegram Trigger, HTTP Request +3
AI & RAG

A sophisticated Telegram bot that provides AI-powered responses with conversation memory. This template demonstrates how to integrate any AI API service with Telegram, making it easy to swap between d

Telegram Trigger, Telegram, HTTP Request
AI & RAG

Template Description This description details the template's purpose, how it works, and its key features. You can copy and use it directly.

Telegram, HTTP Request, Postgres +1