Telegram Webhook
Telegram Webhook connects your flow to a Telegram bot. Every time someone writes to the bot, the flow runs and receives the message: the text, the full message details and, if there is one, the file that was sent (a photo, a voice note, a document, a video…).
It is the starting point of a flow that handles Telegram conversations, for example an assistant that answers your customers.
When to use it
- Build a Telegram assistant that answers your customers’ frequent questions.
- Receive voice notes from sales reps on Telegram and turn them into reports.
- Let the team send photos of receipts or delivery notes to the bot to record them.
- Collect orders or requests that arrive through a company Telegram channel.
Configuration
The component needs a Telegram bot API credential with your bot’s token, the one Telegram gives you when you create the bot with BotFather. See Credentials.
| Field | What it does |
|---|---|
| Credential (required) | The Telegram bot credential. |
| Data | Used to test the flow in the editor: paste a sample message in the format Telegram sends. In production, the message received fills it in. |
Advanced options
| Field | What it does |
|---|---|
| Store Messages | Saves each message received in the conversation history, so the flow remembers what has been said. On by default. |
Connecting the bot to the flow
For the bot’s messages to reach the flow:
- Deploy a version of the flow. See Versions and publishing.
- Open the API Access window and go to the Telegram tab.
- In Telegram Credential, pick the bot’s credential and click Publish.
From then on, the messages the bot receives run the deployed version of the flow. The tab shows Consumed when the bot is connected to this flow. Remove disconnects it.
Output
| Output | What it returns |
|---|---|
| Message | The text the person wrote; for a photo, video or document, the text written with it. Edited messages and posts in a channel the bot belongs to also arrive. Each Telegram chat is treated as its own conversation, so the flow’s memory does not mix users up. Connect it to an agent to reply. |
| Data | All the message details as Telegram sends them: who wrote it, in which chat, the date and the content. Useful to pick out a specific value, such as the chat identifier. |
| Media | The file that comes with the message, if any: photo, voice note, audio, document, video, round video, sticker or animation. Connect it to a component that transcribes audio or reads images. |
Example
A clinic wants to answer questions about opening hours and services on Telegram:
- Add Telegram Webhook and pick the credential of the clinic’s bot.
- Connect Message to an agent with the instructions and the clinic’s information.
- Send the agent’s answer with Telegram Message, to the same chat the message came from.
- Deploy the flow and publish it in the Telegram tab of API Access.
Good practices
- A Telegram bot can only be connected to one flow at a time. If you publish it on another flow, it stops sending messages to the previous one.
- Test in the editor first with a sample message in Data before publishing.
Related components
- Telegram Message: sends messages back to the Telegram chat.
- Webhook Input: receives data from any other application.