Telegram Send Message
Send messages via the Telegram Bot API from a workflow. Use it for bot replies, notifications, confirmations, and any programmatic messaging in Telegram.
Use Telegram Send Message when:
- You need to reply to a user after a Telegram Trigger event
- You want to send notifications or confirmations from a workflow
- You need formatted messages with Markdown or HTML
- An AI Agent should send Telegram messages as a tool
The same TELEGRAM_BOT_TOKEN used by Telegram Trigger works for sending messages.
| Handle | Type | Description |
|---|---|---|
input | any | Upstream data for template expression references in settings bindings. |
| Handle | Type | Description |
|---|---|---|
result | object | Telegram message send result |
The result (accessed as {{ telegram_message.* }}) shape:
| Field | Type | Description |
|---|---|---|
success | boolean | Whether the message was sent successfully |
message_id | number | ID of the sent message |
chat_id | string | Chat ID the message was sent to |
error | string | Error message if success is false |
{
"success": true,
"message_id": 42,
"chat_id": "123456789",
"error": null
}
| Setting | Type | Default | Description |
|---|---|---|---|
chat_id | string | — | Chat ID to send the message to. Required. Supports template expression bindings. |
text | code editor | — | Message text. Required. Supports template expression bindings. |
parse_mode | enum | Markdown | Text formatting mode: Markdown, HTML, or MarkdownV2. |
reply_to_message_id | number | — | Message ID to reply to (threads the response). Supports template expression bindings. |
| Mode | Usage |
|---|---|
Markdown | Legacy Markdown: bold, italic, inline code |
HTML | HTML tags: <b>, <i>, <code> formatting |
MarkdownV2 | Strict MarkdownV2 — special characters must be escaped with a backslash |
Configure on the Env Vars page:
| Env Var | Description |
|---|---|
TELEGRAM_BOT_TOKEN | Bot token from @BotFather (format: 123456:ABC-DEF...). See the Telegram bot tutorial for setup. |
Reply to a user after a Telegram Trigger:
Telegram Trigger → Telegram Send Message
Telegram Send Message settings:
- Chat ID:
{{ telegram.chat_id }} - Message Text:
Hello {{ telegram.from.first_name }}! I received your message. - Reply To Message ID:
{{ telegram.message_id }}
Send a formatted confirmation with Markdown:
- Chat ID:
{{ telegram.chat_id }} - Message Text:
*Order confirmed*\nYour order \#12345` has been placed.` - Parse Mode:
Markdown
Access the result in downstream nodes:
{{ telegram_message.success }}
{{ telegram_message.message_id }}
{{ telegram_message.chat_id }}
import telegram_trigger from @tensorify/telegram-trigger:1.0.0
import telegram from @tensorify/telegram-send-message:1.0.0
node trigger @tensorify/telegram-trigger:1.0.0 {
update_types = ["message"]
}
node reply @tensorify/telegram-send-message:1.0.0 {
chat_id = "{{ telegram.chat_id }}"
text = "Hello {{ telegram.from.first_name }}! I received your message."
reply_to_message_id = "{{ telegram.message_id }}"
}
trigger.payload -> reply.input
Telegram Send Message has an On Error control output branch. Enable it via the "Error output handle" toggle at the bottom of the settings panel.
The error branch fires when:
- The Telegram Bot API returns an error (invalid chat ID, bot blocked, etc.)
TELEGRAM_BOT_TOKENis missing or invalid- Message text fails validation for the selected parse mode
- The user has not started a conversation with the bot
Connect the error output to a fallback notification or If node. On the success path, check {{ telegram_message.success }} — the node does not automatically stop execution on failure.
- Parse mode errors: Invalid formatting for the selected parse mode causes Telegram to reject the message. Test formatting with simple messages first.
- MarkdownV2 escaping: Characters like
.,-,(,)must be escaped in MarkdownV2 mode. - Chat must exist: The user must have started a conversation with your bot before you can send them messages.
- Reply threading: Set
reply_to_message_idto thread your response under the user's original message. Use{{ telegram.message_id }}from a Telegram Trigger. - Check
telegram_message.success: Connect the On Error branch or add an If node to handle send failures.
- Telegram Trigger — receive Telegram updates
- AI Agent — use Telegram Send Message as an agent tool
- Slack Send Message — Slack notifications
- Environment Variables — store your bot token
