Telegram
Description
Section titled “Description”The Telegram module allows sending text messages and files to Telegram chats or groups through the Telegram Bot API. It includes advanced features such as a “typing…” indicator, automatic splitting of long messages (over 4000 characters), retries with exponential backoff for network errors or rate limiting, Markdown format validation, and automatic fallback to plain text if formatting fails. It is ideal for notifications, alerts and automated communication in workflows.
Configuration
Section titled “Configuration”| Parameter | Type | Required | Description |
|---|---|---|---|
| credentials_id | credentials | Yes | Telegram bot credentials |
| chatId | text | Yes | Destination chat or group ID |
| message | textarea | Yes | Message to send (supports {{variable}} variables) |
| parse_mode | select | No | Message format: Markdown V2, HTML or no format |
| show_typing | boolean | No | Show “typing…” indicator before sending (default: true) |
Credentials
Section titled “Credentials”The credential must contain the fields:
botToken: Telegram bot token (obtained from @BotFather, format123456:ABC-DEF...)chatId: Default chat ID (can be overridden by the node’s chatId field or bydata.chatId)
To configure the credentials, first create a bot in Telegram via @BotFather and get the token. The chatId can be obtained by sending a message to the bot and querying the Telegram API.
Output
Section titled “Output”{ "nextModule": "siguiente_modulo", "data": { "status": 200, "telegram_response": "success", "messages_sent": 1 }}Usage Example
Section titled “Usage Example”Basic case
Section titled “Basic case”{ "credentials_id": "cred_telegram_01", "chatId": "-1001234567890", "message": "Pedido {{orderId}} procesado correctamente", "parse_mode": "MarkdownV2", "show_typing": true}API Used
Section titled “API Used”- Send message:
POST https://api.telegram.org/bot{token}/sendMessage - Send document:
POST https://api.telegram.org/bot{token}/sendDocument - Typing action:
POST https://api.telegram.org/bot{token}/sendChatAction - Documentation: https://core.telegram.org/bots/api
- Messages over 4000 characters are automatically split into multiple sends
- If Markdown formatting fails, it automatically retries in plain text
- Supports dynamic variables
{{variable}}in the message field - Includes automatic retries (up to 3) with exponential backoff for 429 and 5xx errors
- File caption is limited to 1024 characters by the Telegram API
- The chatId can come from the input data (
data.chatId), from the node configuration, or from the credentials - The default typing_delay is 300ms between message chunks
Related Nodes
Section titled “Related Nodes”- whatsapp (messaging via WhatsApp/Twilio)
- slack (messaging via Slack)