All nodes/Integrations/Telegram
Telegram Tools
Tool for an AI Agent: one bounded entry point to a Telegram chat — reading (history/search/info), moderation (delete/ban/mute/pin) and administration (title/invites/join requests). Each action is enabled separately in enabled_actions, and the tool list the model sees is filtered further by the type of the current chat. The chat comes from the config or the running turn — the model does NOT choose it. Supports dry_run and a ceiling on ban/mute duration. promote/demote are never offered. Requires a Telegram Config, plus admin rights on the bot for moderation/administration. Connects to the agent through tool_out → extensions.
Type in the graph: telegram_tools
Tool
Try it
Minimal working workflow
- Execute + Data
- Extension
- LLM
- Memory
- Execute + Data + Streaming
Runs as pasted
When to use it
This node gives an AI Agent one bounded door into a Telegram chat: reading (history, search, chat info), moderation (delete, ban, mute, pin) and administration (title, invites, join requests). Reach for it when the model makes the decision — “deal with this complaint”, “summarise the discussion”. When the graph makes the decision, the plain action nodes are cheaper and more predictable: Moderate, Group History, Manage Chat.
How it works
This is not an execution step but a satellite: wire its tool_out output into the agent’s
extensions input. The model sees only the actions ticked in “Enabled actions” (reads
only, by default), and the list is narrowed further by the type of the current chat: muting
is offered in a supergroup alone, the “typing…” status never in a channel.
The chat is never the model’s to choose: it comes from the “Restrict to chat ID” field or from the running Telegram turn. Granting admin rights is not offered at all. Every real moderation action writes an audit record, while dry run and the ban/mute duration ceiling bound what the model can do.
Common mistakes
- Enabling an action is not enough. Moderation and administration need the bot to be an administrator, while reading history and searching need group-history recording. Without them the model gets a refusal and apologises in the chat.
- Errors do not fail the run. The tool returns “Error: …” to the model and the run stays green. If the agent “declined”, read the conversation in the run log rather than the status.
- The chat-type filter is a hint, not a guarantee. The type is inferred from the recorded history; with nothing recorded there is no filtering, and the model may call an action Telegram refuses here.
- Runs that did not start in Telegram. With “Restrict to chat ID” blank there is no chat to infer and every call returns an error. For web chat or a schedule, name the chat explicitly.
- Injection through a group message. A member’s message is text the model reads, and it can contain a request to ban somebody. Enable only the actions you need, keep the duration ceiling, and use dry run while debugging.
- A ceiling of 0 permits a permanent ban. The default is one day.
Inputs
| Port | Wire | Payload | Notes |
|---|---|---|---|
Telegram Configtelegram_config | Datadata | — | shown when connection_source ≠ "auto" |
Outputs
| Port | Wire | Payload | Notes |
|---|---|---|---|
tool_out | Extensionlink_extension | — |
Configuration
| Field | Type | Default | Description |
|---|---|---|---|
Connection sourceconnection_source | string | auto | Where this node gets its connection. 'From the run context' uses what the platform already knows (the Telegram bot this workflow is deployed to / this workspace's own file store) and needs no wiring. 'External connection' shows the resource port so a config node can be wired into it. Options: |
Restrict to chat IDchat_id | string | "" | Pin the tool to one chat. Blank = the chat of the running turn. The model NEVER chooses the chat itself. supports templates |
Dry rundry_run | boolean | false | The model 'performs' mutating actions, but Telegram is never called. |
Enabled actionsenabled_actions | array<string> | ["get_history","search_history","chat_info","get_member"] | Which actions the model may call. Each is toggled separately, and the tool list the model actually sees is filtered further by the type of the current chat (restrict/mute only in supergroups, member_count not in a private chat). Only the read actions are on by default. promote/demote are never available. |
| Advanced | |||
Max ban/mute durationmax_duration_seconds | integer | 86400 | Ceiling, in seconds, on the ban/mute duration the model may ask for. 0 = allow permanent. |