Telegram Trigger

Receives Telegram bot messages and updates and starts workflow execution. Use this to build chatbots and automations that react to Telegram activity.

When to Use

Use Telegram Trigger when:

  • You want to run a workflow when a user sends a message to your bot
  • You need to handle bot commands (e.g., /start) or inline button callbacks
  • Telegram is the event source and your workflow runs asynchronously

For sending messages back to users, pair this with Telegram Send Message.

Setup

  1. Create a bot via @BotFather on Telegram and copy the bot token
  2. Add TELEGRAM_BOT_TOKEN on the Env Vars page
  3. Deploy the workflow to get your trigger URL
  4. Register the webhook with the Telegram Bot API:
https://api.telegram.org/bot{token}/setWebhook?url=https://triggers.tensorify.io/{teamId}/{path}

Replace {token} with your bot token, {teamId} with your Tensorify team ID, and {path} with your workflow's trigger path.

Output

HandleTypeDescription
payloadobjectNormalized Telegram update payload

The payload (accessed as {{ telegram.* }}) shape:

FieldTypeDescription
chat_idnumberChat ID where the update occurred
fromobjectSender object (id, username, first_name, etc.)
textstringMessage text content
message_idnumberTelegram message ID
datenumberUnix timestamp of the message
reply_to_messageobjectOriginal message if this is a reply
update_typestringUpdate type (e.g., message, callback_query)
raw_updateobjectFull Telegram update object for advanced use cases

Settings

SettingTypeDefaultDescription
update_typesmulti-selectmessageUpdate types to listen for: message, edited_message, callback_query, inline_query
command_filterstringOnly trigger for this bot command (e.g., /start). Leave empty to accept all messages.
mockPayloadJSONTest payload injected during canvas testing.

Authentication

Env VarDescription
TELEGRAM_BOT_TOKENBot token from @BotFather (format: 123456:ABC-DEF...)

Example

Handle the /start command and send a welcome message:

  1. Set update_types to message
  2. Set command_filter to /start
  3. Add a Telegram Send Message node
  4. Set Chat ID to {{ telegram.chat_id }}
  5. Set Message Text to your welcome message

Access update data in downstream nodes:

{{ telegram.from.username }}
{{ telegram.text }}
{{ telegram.chat_id }}
{{ telegram.message_id }}
{{ telegram.update_type }}

Common Gotchas

  • One webhook per bot: Telegram allows only one webhook URL per bot. Deploying a new workflow overwrites the previous webhook registration.
  • HTTPS required: Telegram webhooks must use HTTPS. The triggers.tensorify.io endpoint satisfies this requirement.
  • Command filter format: Include the leading slash (e.g., /start, not start).
  • Chat ID types: Private chat IDs are positive numbers; group chat IDs are negative. Use {{ telegram.chat_id }} directly when replying.

See Also

On this page