All nodes/Integrations/Telegram
Telegram Search Messages
Searches the recorded Telegram messages (full-text on PostgreSQL, substring on SQLite). It searches ONLY what the bot observed — the Bot API offers no history search at all. Scope 'This chat' uses the Chat ID, or the chat of the running turn when it is blank; scope 'Every observed chat' searches the whole workspace and must be chosen deliberately. Returns matches with message_id, author and date, newest first.
Type in the graph: telegram_search
Exec
An error branch can be enabled (expose_error_output) to handle failures on their own path.
Try it
Minimal working workflow
- Execute
- Execute + Data
Runs as pasted
When to use it
This node answers “where did we talk about X”. If the question is “what happened in the chat over the last hour”, use Group History — that one has the window and the filters, this one has the keyword. Both read the same recording, so the prerequisites are identical: group-history recording enabled in the deploy panel and privacy mode disabled on the bot (see Telegram channel).
How it works
The Bot API offers bots no message search at all, so the node searches what the bot
managed to record. On PostgreSQL this is a full-text search with the simple
configuration — deliberately without stemming, because the corpus mixes Russian and
English. On SQLite (local development) it degrades to a substring match.
Search scope decides where to look: this chat only (the Chat ID, or the chat of the running turn), or every chat this workspace has observed. The second mode ignores Chat ID and is chosen deliberately — it reads across chats. The Matches output comes back newest first, with a ready-made Transcript beside it.
Common mistakes
- Word forms do not match. Without stemming, “orders” will not find “order” and “running” will not find “run”. Search for the stem, or for the exact form that appears in the conversation.
- A blank query means zero matches, not an error. A template that rendered to an empty string quietly returns an empty list and the run stays green.
- Only recorded messages are searchable. Anything said before recording was switched on, anything in a chat the bot is not in, and anything the ring buffer has evicted is gone for good.
- Chat ID is numeric only and applies in “This chat” scope alone. A blank field there means the chat of the running turn, so a run started from web chat or a schedule stops with an error.
- Matches is an array of rows, not Messages. Wiring it straight into an LLM node is rarely what you want — the Transcript output reads better for a model.
- Deleted messages are excluded. That means deletions the platform knows about: the ones performed by the Moderate node.
Inputs
—
Outputs
| Port | Wire | Payload | Notes |
|---|---|---|---|
Matchesoutput | Execute + Dataexecute_data | array | |
Transcripttranscript | Datadata | string | |
Erroron_error | Execute + Dataexecute_data | — | shown when expose_error_output = true |
Configuration
| Field | Type | Default | Description |
|---|---|---|---|
Chat IDchat_id | string | "" | Numeric Telegram chat_id (an @username is not accepted here). Blank = the chat of the running Telegram turn. Templates are supported. supports templates shown when chat_scope = current |
Search scopechat_scope | string | current | current — search one chat: the Chat ID below, or the chat of the running Telegram turn when it is blank. workspace — search every chat this workspace has observed, ignoring Chat ID. Options: |
Limitlimit | integer | 50 | Maximum number of matches. |
Queryquery | string | "" | Text to look for in recorded messages. On PostgreSQL this is a full-text search (the 'simple' configuration — no stemming, because the corpus is mixed RU/EN); on SQLite it degrades to a substring match. supports templates |
Sincesince | string | "" | Window bound: an ISO timestamp (2026-07-01T00:00:00Z) or a window relative to now (30m, 24h, 7d). Blank = unbounded. supports templates |
Untiluntil | string | "" | Window bound: an ISO timestamp (2026-07-01T00:00:00Z) or a window relative to now (30m, 24h, 7d). Blank = unbounded. supports templates |
From useruser_id | string | "" | Only messages by this author. Numeric Telegram user_id. Templates are supported. supports templates |
| Advanced | |||
Include botsinclude_bots | boolean | true | Include messages posted by bots. |
Shared fields
Every node has these three — the platform adds them, not the node author.
expose_error_output— When enabled, show an execution output to connect nodes that run if this step fails.