Skip to content

Telegram ​

Sends a message or attachments to a Telegram chat through your bot, or fetches the file of a received message.

The Telegram node writes through your bot: a message (plain text, Telegram HTML or MarkdownV2, optionally as a reply and without notification), the email’s attachments (one message per file, the caption on the first), or it fetches the document of a received message into the run’s attachments.

The chat is designated by its numeric id — {{ data.telegram.chatId }} when the workflow starts from the Telegram — message received trigger — or @channel_name for a public channel.

It works with a Telegram connection. See Telegram.

At a glance ​

  • Type: telegram.api · version 1
  • Category: Data
  • Kind: Step — one stage of a run
  • Effect: Writes outside (external_write) — writes outside Loop & Roll; described instead of performed during a test run
  • Needs a carrier email: No
  • Connection: Telegram
  • Inputs: main
  • Outputs: main
The ports of “Telegram”: what comes in on the left, what goes out on the rightInput: main. Outputs: main. An error output appears when its failure setting is “Follow the Error output”. It needs a Telegram connection.Telegramtelegram.apimainmainerror · only with “Follow the Error output”Connection: Telegram
The ports of “Telegram”: what comes in on the left, what goes out on the right

Connection ​

This node needs a Telegram connection.

Parameters ​

connection ​

Telegram connection — The Telegram connection to use. Create it once in Connections; its key never appears in the workflow.

  • Type: Connection (credential)
  • Required: Yes
  • Default: "" (empty)

action ​

Action

  • Type: One choice (options)
  • Required: Yes
  • Default: send
  • Options:
    • send — Send a message
    • sendDocuments — Send attachments: The email’s attachments or those added by an earlier step, one per message.
    • downloadFile — Fetch a received file: The document or photo of a received message, stored in the run’s attachments.

chatId ​

Chat (id) — The chat’s numeric id ({{ data.telegram.chatId }} from the trigger) or @channel_name for a public channel.

  • Type: Text (string)
  • Required: Yes
  • Default: "" (empty)
  • 64 characters at most
  • Example: -1001234567890
  • Shown when: action is one of send, sendDocuments
  • Expressions: {{ }} accepted

text ​

Message — 4,096 characters at most (beyond that, the text is cut). Accepts {{ }} expressions.

  • Type: Long text (text)
  • Required: Yes
  • Default: "" (empty)
  • 8000 characters at most
  • Shown when: action is send
  • Expressions: {{ }} accepted

caption ​

Caption — Set on the first file, 1,024 characters at most.

  • Type: Long text (text)
  • Required: No
  • Default: "" (empty)
  • 2000 characters at most
  • Shown when: action is sendDocuments
  • Expressions: {{ }} accepted

parseMode ​

Formatting

  • Type: One choice (options)
  • Required: No
  • Default: none
  • Options:
    • none — Plain text
    • HTML — Telegram HTML
    • MarkdownV2 — Telegram MarkdownV2
  • Shown when: action is one of send, sendDocuments

replyTo ​

In reply to message — Optional: the id of the message to reply to ({{ data.telegram.messageId }}).

  • Type: Text (string)
  • Required: No
  • Default: "" (empty)
  • 32 characters at most
  • Shown when: action is send
  • Expressions: {{ }} accepted

silent ​

Without notification — The message arrives without sound or vibration.

  • Type: Yes / no (boolean)
  • Required: No
  • Default: false
  • Shown when: action is one of send, sendDocuments

selection ​

Attachments to use

  • Type: One choice (options)
  • Required: Yes
  • Default: all
  • Options:
    • all — All attachments: Those of the triggering email, then the files added by earlier steps (a fetched deed, a signed PDF), in that order.
    • first — The first one only: The first attachment, when only one matters.
    • byMime — By file type: By MIME type: application/pdf, or a whole family with image/*.
    • byName — By file name: By name pattern: *.pdf, invoice-*.
  • Shown when: action is sendDocuments

mime ​

File type — Exact MIME type (application/pdf) or a whole family (image/*). Left empty, no attachment is kept.

  • Type: Text (string)
  • Required: No
  • Default: "" (empty)
  • 200 characters at most
  • Example: application/pdf
  • Shown when: action is sendDocuments and selection is byMime
  • Expressions: {{ }} accepted

namePattern ​

File name — Simple pattern: * matches anything, ? one character (*.pdf, invoice-*). Case is ignored.

  • Type: Text (string)
  • Required: No
  • Default: "" (empty)
  • 200 characters at most
  • Example: *.pdf
  • Shown when: action is sendDocuments and selection is byName
  • Expressions: {{ }} accepted

fileId ​

File id — The file_id given by the trigger ({{ data.telegram.document.fileId }}).

  • Type: Text (string)
  • Required: Yes
  • Default: "" (empty)
  • 512 characters at most
  • Shown when: action is downloadFile
  • Expressions: {{ }} accepted

filename ​

File name — Optional ({{ data.telegram.document.fileName }}). Empty: the file’s name at Telegram.

  • Type: Text (string)
  • Required: No
  • Default: "" (empty)
  • 255 characters at most
  • Shown when: action is downloadFile
  • Expressions: {{ }} accepted

Outputs ​

  • main — Taken once Telegram has accepted the call. An error answer (bot not in the chat, file too large) fails the step instead.

Data produced ​

What this node adds to the run data, and how to read it in an expression. <step> stands for the step key: the node name turned into an identifier (see Data and expressions).

  • {{ data.<step>.messageId }} — string. Send a message: the id of the message sent.
  • {{ data.<step>.messageIds }} — array. Send attachments: the ids of the messages sent, one per file.
  • {{ data.<step>.chatId }} — string. The chat written to.
  • {{ data.<step>.truncated }} — boolean. true when the text was cut at 4,096 characters.
  • {{ data.<step>.attachmentPosition }} — number. Fetch a received file: the file’s position in the run’s attachments, for a later Compose step.
  • {{ data.<step>.filename }} — string. Fetch a received file: the file name.
  • {{ data.<step>.simulated }} — boolean. true when the call was described instead of done (test run).
  • {{ data.<step>.summary }} — string. The one-line summary in the member’s language.

Loop & Roll — the workflow builder for email.