Check out the agents documentation to build conversational agents on Telegram. Users message your bot in Telegram and your agent replies in the same chat.
Prerequisites
- A Telegram account
- Access to @BotFather to create a bot and obtain its token
- Access to the Novu dashboard
Create a Telegram bot
Every Telegram integration uses one bot. Create it with BotFather before adding the provider in Novu.Open BotFather
Open @BotFather in Telegram (mobile or desktop).
Run /newbot
Send the
/newbot command and follow the prompts to choose a display name and a username (must end in bot, for example acme_alerts_bot).Configure Telegram in Novu
Save the bot token
Paste the full BotFather confirmation message into the credentials form, or paste the token directly into the API Token field.On mobile, scan the QR code in the form to open a setup page and paste the BotFather message from the device where you received it.
Connect a subscriber’s Telegram chat
Before Novu can deliver messages, each subscriber must connect their Telegram chat.Connection link (recommended)
Novu gives you a link that opens your bot in Telegram. When the subscriber taps Start, their chat is linked to their Novu subscriber profile.The connection link flow is available when Telegram is set up on an agent. If you only need one-way workflow notifications and already know a subscriber’s Telegram chat ID, you can register it with the channel endpoints API instead.
From your backend
Request a connection URL from your server when the subscriber chooses to connect Telegram:- cURL
url in a new tab or show it as a button in your UI. Generate a fresh link each time the subscriber starts the flow — links expire after a short time.
From your app with @novu/react
For agent applications, use TelegramConnectButton inside NovuProvider. It opens Telegram for the subscriber and confirms when the chat is connected.
Send chat workflow notifications
Once subscribers have connected Telegram, add a Chat step to a workflow and trigger it as usual.Add a Chat step
In the Novu dashboard, open your workflow, add a step, and select Chat as the channel.
Write the message body
Compose the message content. Use dynamic placeholders such as
{{subscriber.firstName}} or payload variables from your trigger.Using Telegram with agents
Telegram is a supported agent provider. Connect your bot to an agent so users can message the bot and get replies in the same chat — without building Telegram integrations yourself.Build agents on Telegram
Learn how Novu agents work, including managed and custom code agents.
What you get
When Telegram is connected to an agent:- Users message your bot in Telegram and your agent responds in that chat
- Conversations appear in the dashboard under Agent Conversations
- Supported content includes text, markdown, files, reactions, and typing indicators
Set up Telegram for an agent
Create or open an agent
In the Novu dashboard, go to Agents and create an agent or open an existing one.
Add Telegram as a provider
Add Telegram as a provider. Novu creates the integration and links it to your agent.
Save the bot token
Follow the setup guide in the dashboard: create a bot with BotFather, paste the confirmation message (or use the mobile QR setup page), and save your credentials.
Let your users connect Telegram in your app
AddTelegramConnectButton to your app (see Connect a subscriber’s Telegram chat) or request a connection URL from your backend and send users to that link.
After a chat is connected, messages to your bot are handled by your agent. Replies show up in the same Telegram chat.
Agent conversations vs. workflow notifications
| Use case | What happens |
|---|---|
| Agent conversation | The user messages your bot and your agent replies in the same chat. |
| Workflow notification | You trigger a workflow with a Chat step and Novu sends a one-way message to the subscriber’s linked chat. |
Related
Adding a chat channel
General steps for enabling the Chat channel and wiring it into workflows.
Connect components
Prebuilt React buttons for Slack, Teams, Telegram, and more.