Skip to content

Telegram

Your agent answers as a Telegram bot. The bot is private: it only talks to people who joined with an invite link you generated.

  • A workspace role that can edit Agents (agents.edit). Connecting the bot and creating invite links need it too.
  • A Telegram account, to create the bot
  • A VirtuAI address reachable over public HTTPS. Telegram doesn’t deliver messages to anything else.
  1. In Telegram, open a chat with @BotFather and send /newbot.

  2. Choose a display name and a username. The username must end in bot, for example acme_support_bot.

  3. Copy the token BotFather sends you. It looks like 1234567890:ABCdef....

  1. Open the agent and select its Channels tab. On the canvas, select the agent, or its Telegram node, to open the same tabs.

  2. Turn on Telegram. Until it’s connected, the card reads Needs a bot token.

  3. Paste the token in Bot token (from @BotFather) and select Connect bot.

  4. Optionally, change the Waiting message. The default is ⏳ Working on your request...

Connect bot does it all in one step: it checks the token with Telegram, saves it, and registers the agent’s webhook with Telegram together with a secret VirtuAI generates. The card then reads Connected as the bot’s username, and shows the Webhook URL:

https://<your-virtuai-host>/telegram/webhook/<agent-id>

Telegram sends the secret with every message, and VirtuAI ignores any request that doesn’t carry it. You never see or enter the secret. If Telegram refuses the token, nothing is saved and the card says why. If the token is saved but Telegram doesn’t accept the webhook, the card reads Needs attention and says what to fix, for example that Telegram needs a public HTTPS address.

The Telegram connection and the Telegram switch apply at once, also to the published version of an agent with versioning.

You can connect again at any time with Reconnect, for example after the bot was moved to another agent, or paste a new token and select Connect bot. Turning Telegram off disconnects the bot and removes its token and settings from the agent, after you confirm.

  1. In the Telegram card, under Invite link, select Generate. It’s available once the bot is connected.

  2. Copy the link and send it to one person. Each link works once and expires after 24 hours.

  3. The person opens the link and taps Start in Telegram. The bot answers “✅ You’re all set! Send me a message to get started.”

Everyone who joined is listed under Authorized users. Select Revoke to remove someone. Anyone who isn’t on the list gets “⛔ You’re not authorized. Ask your administrator for an invite link.”

After someone joins, the bot also sends a link to “link your VirtuAI account”. Linking lets the agent use that person’s connected apps, such as Gmail, Google Drive or Calendar, when it answers them on Telegram. People who don’t need connected apps can skip it.

To link, the person opens the link within 1 hour, signs in to VirtuAI, and selects Link My Account. Only a member of the agent’s workspace can link: anyone else is told “Your account is not a member of the workspace this bot belongs to”.

Command What it does
/new [title] Starts a new conversation, with an optional title
/resume Shows your recent conversations as buttons. Tap one to switch to it.
/status Tells you whether the agent is working, and for how long
/compact Summarizes the older messages so the conversation can keep going when the model’s context fills up. The agent suggests it from 80%.
/cancel Cancels the queued message. The current task finishes, but its answer isn’t sent.
/help Lists the commands

To show these in Telegram’s command menu, send them to BotFather with /setcommands.

  • Progress. The bot posts the waiting message as the caption of a small animation, then shows the agent’s steps while it works. The answer follows when it’s done, and the waiting message is removed.
  • Busy agent. If you write while the agent is working, the bot answers “✉️ Got it — I’ll respond once I finish your current request.” and handles your message next.
  • Replies. When you reply to a message, its text is sent to the agent as context.
  • Files you send. Send documents, photos, videos or audio. A caption is read as your message. Each file goes into the agent’s working folder, under uploads/, where the agent runs commands, so it can open and work on it. Photos and PDFs also go to the model itself when it can read them. Telegram lets bots download files up to 20 MB; for a larger one, the bot answers “⚠️ I could not receive: …”. See Files and voice notes.
  • Files while the agent is busy. A file sent while the agent is still working isn’t queued. The bot answers “📎 I’m still working on your previous request. Send the file again when I finish.”
  • Voice notes. Voice notes and audio are transcribed, and the agent gets your words, whatever its model.
  • Thinking and web searches. When the model thinks or searches the web, the steps show it, marked 💭 for a thought and 🌐 for a search, as web chat does.
  • Files from the agent. Files the agent creates are sent to you as Telegram documents.
  • Long answers. Answers longer than Telegram’s 4,096-character limit arrive as several messages.
  • Budgets. If the workspace has run out of budget, the bot replies with the budget message instead of an answer.
  • Your browser. When the agent uses the workspace’s Browser and a step needs you (a captcha, a sign-in, a two-step code, an approval), it sends you a link to your own browser desktop, which opens after you sign in to VirtuAI. See Sandboxes.
  • Reminders. With the reminder tools attached to the agent, you can ask it to remind you of something, once or daily, weekly or monthly. At the time, the bot posts ⏰ Reminder… in your chat and the agent reminds you. Times are in the workspace’s time zone, and due reminders go out every few minutes (every 5 minutes by default). See Predefined tools.
  • Local models. Agents with a local model answer here too. Your own runner serves your turns once VirtuAI recognizes you (after you link your VirtuAI account); otherwise a workspace inference host or the cloud fallback answers. See Local models.

When a deep agent wants to run a command, or use a tool that needs approval, the bot posts Approval needed in the chat where you wrote, with what it would run, and the same answers as web chat’s card:

Button What it approves
✅ Allow once This call only. The next one asks again.
💬 This conversation This call and the next ones in this Telegram chat. Another chat asks again.
⏱ 60 min Your calls to this agent on Telegram for the next 60 minutes, in any chat.
♾ Always Your calls to this agent on Telegram until someone who can edit the agent revokes it.
❌ Deny Nothing runs, and the agent is told you declined.

Nothing runs until you tap. Only the person whose message started the task can answer: if someone else in a group taps, Telegram shows them, and only them, “Only the person who sent the message can approve or deny this.”, and the buttons stay. Once answered, the buttons are replaced by who answered and for how long, for example “✅ Approved by @ana — for this conversation”. A broader answer covers only you, this agent and Telegram: it doesn’t answer for other people in the group, or for you on another channel. If the agent asked for several calls at once, a broader answer on one also approves the others it covers, and their messages say “Approved by your earlier answer” with the scope of that answer. With no answer within 10 minutes, the request expires, the message says “⌛ Expired with no answer. Nothing was run.”, and nothing is run.

An approval you gave in web chat also counts here once you’ve linked your VirtuAI account. People who can edit the agent can see and revoke these approvals under Standing approvals, in the agent’s Security tab.

“Telegram needs a public HTTPS address for its webhook” : Your VirtuAI address isn’t reachable over public HTTPS, so Telegram can’t deliver to it. The token is saved; ask your VirtuAI administrator to make the address public over HTTPS, then select Reconnect.

The bot doesn’t answer at all : Check that the agent’s Telegram card reads Connected, and select Reconnect if it doesn’t. Check that no other agent connected the same bot afterwards, which moves it there. Messages sent before the bot was connected are ignored.

“❌ Invalid or expired invite link” : The link was already used, is older than 24 hours, or belongs to another agent. Generate a new one.

Linking fails with “Invalid or expired link token” : The link is older than 1 hour or was already used. Ask for a new invite link and open it: the bot sends a new linking link after you join.

“Connect the bot to generate invite links.” : Invite links need a connected bot. Select Connect bot first.