💬 Telegram bot with menu-driven commands

19,008 views · 💬 Support Chatbots

Description

This template provides a structured way to build Telegram bots that respond to specific commands and handle user input. It allows users to interact with your bot by selecting options from a Telegram bot menu, without needing to type out full instructions or rely on conversational AI. This approach offers precise control and predictable behavior for command-driven interactions.

Key Features:

Why This Template is Unique:

n8n currently lacks a native, built-in mechanism for handling individual Telegram commands in a structured, non-conversational way. Many users resort to “AI Agent” nodes, which are designed for open-ended conversations. This template fills that gap by providing a framework for:

How to Use:

  1. Initialization (One-Time): Execute the “Temp to Initiate Static Data” node once to create the necessary telegramStates object in the workflow’s static data. This is crucial for state management.
  2. Customize Processing Logic: Replace the NoOp nodes (Command1 processing, Command2 processing, Command3 processing) with your own nodes to handle the content received for each command. It is highly recommended to add input validation within your processing logic.
  3. Telegram Credentials: Configure the Telegram Trigger and Telegram nodes with your bot’s API token.

Example Use Case:

This template is ideal for creating bots that require a command followed by specific input, such as:

🔗 Nodes Used

Telegram, Telegram Trigger

📥 Import

Download workflow.json and import into n8n: Workflow menu → Import from File

📖 Importing guide · 🔑 Credential setup