AutomationFlowsSlack & Telegram › Telegram Listener

Telegram Listener

01 - Telegram Listener. Uses telegram, httpRequest. Webhook trigger; 8 nodes.

Webhook trigger★★★★☆ complexity8 nodesTelegramHTTP Request
Slack & Telegram Trigger: Webhook Nodes: 8 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
{
  "name": "01 - Telegram Listener",
  "description": null,
  "active": true,
  "isArchived": false,
  "nodes": [
    {
      "id": "t0",
      "name": "Telegram Webhook",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [
        200,
        300
      ],
      "parameters": {
        "path": "telegram-bot-webhook",
        "httpMethod": "POST",
        "responseMode": "onReceived",
        "options": {}
      }
    },
    {
      "id": "t1",
      "name": "Extract Message Data",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        420,
        300
      ],
      "parameters": {
        "jsCode": "// Extract message data from Webhook body + owner check\nconst raw = $input.first().json;\nconst body = raw.body || raw;\nconst msg = body.message || body;\nconst userId = msg?.from?.id || 0;\nconst username = msg?.from?.username || '';\nconst firstName = msg?.from?.first_name || '';\nconst text = msg?.text || '';\nconst chatId = msg?.chat?.id || 0;\nconst OWNER = $env.TELEGRAM_OWNER_USERNAME || '__OWNER_NOT_SET__';\nconst isOwner = username.toLowerCase() === OWNER.toLowerCase();\nconst isCommand = text.startsWith('/');\n// Expose as 'text' and 'message' \u2014 workflow 02 AI Agent reads 'message'\nreturn [{ json: { userId, username, firstName, text, message: text, chatId, isCommand, isOwner } }];"
      }
    },
    {
      "id": "t2",
      "name": "Is Owner?",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2,
      "position": [
        640,
        300
      ],
      "parameters": {
        "conditions": {
          "options": {
            "leftValue": "",
            "rightValue": "",
            "caseSensitive": true
          },
          "combinator": "and",
          "conditions": [
            {
              "leftValue": "={{ $json.isOwner }}",
              "rightValue": true,
              "operator": {
                "type": "boolean",
                "operation": "equals"
              }
            }
          ]
        }
      }
    },
    {
      "id": "t3",
      "name": "Reject Access",
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.2,
      "position": [
        860,
        500
      ],
      "parameters": {
        "chatId": "={{ $json.chatId }}",
        "text": "\u26d4 This bot is private. Access denied.",
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "id": "t4",
      "name": "Is Command?",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2,
      "position": [
        860,
        300
      ],
      "parameters": {
        "conditions": {
          "options": {
            "leftValue": "",
            "rightValue": "",
            "caseSensitive": true
          },
          "combinator": "and",
          "conditions": [
            {
              "leftValue": "={{ $json.isCommand }}",
              "rightValue": true,
              "operator": {
                "type": "boolean",
                "operation": "equals"
              }
            }
          ]
        }
      }
    },
    {
      "id": "t5",
      "name": "Execute Command Handler",
      "type": "n8n-nodes-base.executeWorkflow",
      "typeVersion": 1,
      "position": [
        1080,
        200
      ],
      "parameters": {
        "workflowId": "__REWRITTEN_AT_STARTUP__",
        "options": {}
      }
    },
    {
      "id": "t6-typing",
      "name": "Send Typing",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1080,
        420
      ],
      "parameters": {
        "method": "POST",
        "url": "=https://api.telegram.org/bot{{ $env.TELEGRAM_BOT_TOKEN }}/sendChatAction",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify({ chat_id: $json.chatId, action: 'typing' }) }}",
        "options": {
          "response": {
            "response": {
              "neverError": true
            }
          },
          "timeout": 3000
        }
      },
      "continueOnFail": true
    },
    {
      "id": "t7",
      "name": "Execute AI Chat",
      "type": "n8n-nodes-base.executeWorkflow",
      "typeVersion": 1,
      "position": [
        1300,
        420
      ],
      "parameters": {
        "workflowId": "__REWRITTEN_AT_STARTUP__",
        "options": {}
      }
    }
  ],
  "connections": {
    "Telegram Webhook": {
      "main": [
        [
          {
            "node": "Extract Message Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Message Data": {
      "main": [
        [
          {
            "node": "Is Owner?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Is Owner?": {
      "main": [
        [
          {
            "node": "Is Command?",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Reject Access",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Is Command?": {
      "main": [
        [
          {
            "node": "Execute Command Handler",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send Typing",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Typing": {
      "main": [
        [
          {
            "node": "Execute AI Chat",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1",
    "errorWorkflow": "",
    "callerPolicy": "any"
  },
  "staticData": null,
  "meta": null,
  "tags": [],
  "parentFolder": null
}

Credentials you'll need

Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.

Pro

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

About this workflow

01 - Telegram Listener. Uses telegram, httpRequest. Webhook trigger; 8 nodes.

Source: https://github.com/rohankag/ronkbot/blob/db03432335532bdeb4ebcee0c72d9109e04b466f/n8n-workflows/01-telegram-listener.json — original creator credit. Request a take-down →

More Slack & Telegram workflows → · Browse all categories →

Related workflows

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

Slack & Telegram

WF_UNIFIED_LEGAL_AUTOMATION. Uses googleSheets, httpRequest, telegram, telegramTrigger. Webhook trigger; 53 nodes.

Google Sheets, HTTP Request, Telegram +1
Slack & Telegram

qualiopi. Uses airtable, telegram, emailSend, httpRequest. Webhook trigger; 51 nodes.

Airtable, Telegram, Email Send +3
Slack & Telegram

PsyCardv2. Uses executeCommand, telegram, readBinaryFile, googleDrive. Webhook trigger; 41 nodes.

Execute Command, Telegram, Read Binary File +2
Slack & Telegram

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

HTTP Request, Redis, S3 +1
Slack & Telegram

How it works • Webhook triggers from content creation system in Airtable • Downloads media (images/videos) from Airtable URLs • Uploads media to Postiz cloud storage • Schedules or publishes content a

Airtable, Telegram, HTTP Request