AutomationFlowsSlack & Telegram › Telegram message handler with HTTP requests

Telegram message handler with HTTP requests

Original n8n title: Workflow 0 - Gestion Telegram

Workflow 0 - Gestion Telegram. Uses telegramTrigger, httpRequest. Event-driven trigger; 5 nodes.

Event trigger★★★★☆ complexity5 nodesTelegram TriggerHTTP Request
Slack & Telegram Trigger: Event Nodes: 5 Complexity: ★★★★☆ Added:

This workflow follows the HTTP Request → Telegram Trigger 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": "Workflow 0 - Gestion Telegram",
  "nodes": [
    {
      "parameters": {
        "updates": [
          "*"
        ],
        "additionalFields": {}
      },
      "type": "n8n-nodes-base.telegramTrigger",
      "typeVersion": 1.2,
      "position": [
        -256,
        -112
      ],
      "id": "86ea4e47-4c45-4cc9-81dd-e638a5e4f557",
      "name": "Telegram Trigger",
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "jsCode": "// Analyser le type de message/callback re\u00e7u\nconst data = $json;\n\nlet routeTo = null;\nlet forwardData = null;\n\n// CAS 1 : Message texte (commandes /scrape avec texte ou /help)\nif (data.message && data.message.text) {\n  const text = data.message.text.trim();\n  \n  // Utilisation d'une Regex pour v\u00e9rifier \"/scrape\" + au moins un caract\u00e8re apr\u00e8s l'espace\n  const scrapeMatch = text.match(/^\\/scrape\\s+(.+)/);\n  \n  if (scrapeMatch || text === '/help') {\n    routeTo = 'workflow1';\n    forwardData = data;\n  }\n}\n\n// CAS 2 : Callback query (boutons Postuler/Passer)\nelse if (data.callback_query) {\n  routeTo = 'workflow2';\n  forwardData = data;\n}\n\n// CAS 3 & ARR\u00caT : Si aucune route n'est d\u00e9finie (ex: /scrape tout seul ou message inconnu)\nif (!routeTo) {\n  // En retournant un tableau vide, n8n n'ex\u00e9cutera PAS les n\u0153uds suivants sur cette branche.\n  return [];\n}\n\n// Si on arrive ici, on a une route valide\nreturn [{\n  json: {\n    routeTo: routeTo,\n    data: forwardData\n  }\n}];"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        -48,
        -112
      ],
      "id": "760a1619-c366-4ed4-aebb-97de537a0bfc",
      "name": "Code in JavaScript"
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 3
          },
          "conditions": [
            {
              "id": "c5a454a6-252f-48c3-8fac-26e58e437fb0",
              "leftValue": "={{ $json.routeTo }}",
              "rightValue": "workflow1",
              "operator": {
                "type": "string",
                "operation": "equals",
                "name": "filter.operator.equals"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.3,
      "position": [
        160,
        -112
      ],
      "id": "9b911ccb-ab67-46c2-bcd1-222d9169a42b",
      "name": "If"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://your-domain.com/webhook/workflow1-scrape",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify($json.data) }}",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.4,
      "position": [
        400,
        -208
      ],
      "id": "4757a8d9-49de-45c3-810d-906d762679a7",
      "name": "HTTP Request Workflow1"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://your-domain.com/webhook/workflow2-apply",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify($json.data) }}",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.4,
      "position": [
        400,
        16
      ],
      "id": "bf5f9155-29b4-4c76-b0cb-aad17ae2a3a4",
      "name": "HTTP Request Workflow2"
    }
  ],
  "connections": {
    "Telegram Trigger": {
      "main": [
        [
          {
            "node": "Code in JavaScript",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code in JavaScript": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If": {
      "main": [
        [
          {
            "node": "HTTP Request Workflow1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "HTTP Request Workflow2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": true,
  "settings": {
    "executionOrder": "v1",
    "binaryMode": "separate",
    "availableInMCP": false
  },
  "versionId": "ba4bbf52-ccff-41fa-a760-3ddae83281da",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "id": "QNpXB8MS_W1HizKYeHS0Y",
  "tags": []
}

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

Workflow 0 - Gestion Telegram. Uses telegramTrigger, httpRequest. Event-driven trigger; 5 nodes.

Source: https://github.com/ArthSogh/autoapply-n8n-bot/blob/d2ddb4efbe69bf539e061e7e86ad32ab0eea8372/workflows/W0_Router.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

N8N Complete Final. Uses telegramTrigger, dataTable, telegram, mqtt. Event-driven trigger; 58 nodes.

Telegram Trigger, Data Table, Telegram +3
Slack & Telegram

TextMain. Uses telegramTrigger, stopAndError, telegram, httpRequest. Event-driven trigger; 56 nodes.

Telegram Trigger, Stop And Error, Telegram +2
Slack & Telegram

Pede Ai. Uses httpRequest, telegram, postgres, telegramTrigger. Event-driven trigger; 53 nodes.

HTTP Request, Telegram, Postgres +1
Slack & Telegram

📄 Documentation: Notion Guide

Telegram Trigger, @Blotato/N8N Nodes Blotato, Telegram +1
Slack & Telegram

Telegram Wait. Uses stickyNote, httpRequest, redis, noOp. Event-driven trigger; 36 nodes.

HTTP Request, Redis, Telegram +1