telegram
integration holding its token, and a telegram.message.inbound
trigger pointing at a published text agent. Telegram is
a channel integration: it lends an agent no tools and cannot be attached under
mcps.
Set it up
1
Create a bot with BotFather
Message @BotFather, send
/newbot, and choose a
display name and username. BotFather answers with a token shaped
123456789:AAH…; treat it like a password. Do not set a webhook in
BotFather — Talqing registers it when you enable the trigger.2
Create the integration
Send the bot token as The token is checked with Telegram’s
credentials_ref and a webhook secret of your choosing
as webhook_config.secret_token — 1–256 letters, digits, underscores and
hyphens. Telegram sends the secret back in
X-Telegram-Bot-Api-Secret-Token on every delivery, and a delivery without
it is refused with 403. Both are stored as
workspace secrets (TELEGRAM_BOT_TOKEN,
TELEGRAM_WEBHOOK_SECRET); reads return the {{secrets.NAME}} reference.getMe before the integration is saved,
so a bad token fails here. One bot is one integration; a second is refused
with a Telegram integration with that bot already exists.3
Create the trigger
The agent must be published, and its published version must be on the
Enabling calls Telegram’s
text channel.setWebhook and sets the trigger’s status to
active. Messages sent to the bot while no webhook was registered are
dropped, not answered late.4
Message the bot
Open a private chat with the bot and send something. A typing indicator
shows for the whole turn, then the reply. The thread appears under
Conversations with surface
telegram.When enabling fails
Fix the cause and
PATCH the trigger with enabled: true; registration is
retried each time. Disabling or deleting the trigger or the integration calls
deleteWebhook.
What Telegram delivers
- Private chats only. Messages from groups, supergroups and channels are discarded.
- Text only. Photos, stickers, voice notes, documents and locations are ignored; the agent is not told they arrived.
- Replies longer than 4,096 characters are split at the last line or word break.
The conversation keeps one item; if a later part fails after earlier parts were
sent, the item is marked
failedand not retried.
How a person becomes a chat
The first message from a person creates a contact and starts a chat with the trigger’s agent.
Every message joins the same chat until it ends. It ends when the agent runs
end_call, you call POST /v1/chats/{id}/end, or 24 hours
pass without a message from the person (inactivity_timeout); the next message
starts a new chat, in a new
conversation unless the agent’s
conversation.context is transcript.
Analysis and session.completed happen only when
a chat ends, so give the agent an end_call tool and say in the prompt when the
conversation is over.
- Pointing the trigger at another agent ends the chats it opened
(
close_reason: "replaced") at once; turning it off ends every open chat (messages_off). A chat whose agent a post chose keeps running. - Republishing the agent reaches open chats on the next message.
{{vars.*}}come only from a post that chooses the agent; otherwise the agent runs on its declared defaults. Put per-person data in userdata.
GET /v1/chats?contact_key=telegram:123456789:987654321
or GET /v1/conversations?contact_key=… (conversations).
reply_mode
Next
Triggers
The trigger model, statuses, and the rules enabling one checks.
Chats
How a chat starts and ends, its items, and what it costs.