Telegram TelegramSend

Telegram TelegramSend

Certified

Send a Telegram chat message or file

Sends text using Telegram sendMessage, or uploads a file using sendDocument when from is set. Files can come from an earlier task's output and have an optional caption. Supports HTML/MarkdownV2 formatting, HTTP client overrides and an optional API endpoint override for local testing.

yaml
type: io.kestra.plugin.telegram.TelegramSend

Send a Telegram message on a failed flow execution.

yaml
id: unreliable_flow
namespace: company.team

tasks:
  - id: fail
    type: io.kestra.plugin.scripts.shell.Commands
    runner: PROCESS
    commands:
      - exit 1

errors:
  - id: alert_on_failure
    type: io.kestra.plugin.telegram.TelegramSend
    token: "{{ secret('TELEGRAM_TOKEN') }}" # format: 6090305634:xyz
    channel: "2072728690"
    parseMode: HTML
    payload: "<b>Telegram Alert</b>"

Send a file produced by an earlier task with a caption.

yaml
id: send_report_to_telegram
namespace: company.team

tasks:
  - id: report
    type: io.kestra.plugin.core.storage.Write
    extension: .csv
    content: |
      name,total
      example,42

  - id: send_file
    type: io.kestra.plugin.telegram.TelegramSend
    token: "{{ secret('TELEGRAM_TOKEN') }}"
    channel: "{{ secret('TELEGRAM_CHAT_ID') }}"
    from: "{{ outputs.report.uri }}"
    caption: "<b>Report</b> for {{ flow.id }}"
    parseMode: HTML
Properties

Chat ID or channel ID

Target chat identifier for the user or channel; supports expressions.

Bot access token

Telegram Bot API token; store as a secret and avoid hardcoding.

Assets this task consumes as inputs or produces as outputs, for lineage tracking and the asset graph (Enterprise Edition). A flow declaring this property on a task is rejected in the open-source edition.

Definitions
assetFailureBehaviorstring
Possible Values
IGNOREFAILWARN

Asset failure behavior

Behavior applied to the task state when a declared asset fails to render, emit, or be persisted (e.g. a lock conflict): FAIL escalates it to FAILED, WARN (default) warns it if it would otherwise succeed, IGNORE leaves the state untouched.

enableAutobooleanstring

Whether to auto-register assets referenced dynamically at runtime that are not statically declared in inputs or outputs.

inputsarray

The assets consumed as inputs.

id*string
Min length1
typestring
outputs

The assets produced as outputs.

id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*string
Min length1

Custom asset type

descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150

Document caption

Optional caption for the uploaded file when from is set. Ignored for text messages. Supports expressions and the formatting specified by parseMode. Telegram allows up to 1024 characters after entities parsing.

Custom Telegram API base URL

Override the Telegram API endpoint for local testing; defaults to https://api.telegram.org.

File to send

URI of the file to upload as a Telegram document, for example {{ outputs.report.uri }}. Accepts Kestra internal storage (kestra://), namespace files (nsfile://) and local files (file://). Supports expressions. The file is read through Kestra and uploaded with the filename from the URI; the URI itself is not sent to Telegram. When set, payload is unused and caption is optional.

Configure Telegram HTTP client

Optional HTTP client overrides for Telegram calls. Leave unset to use defaults: 10s read timeout, 5m read idle timeout, 10 MB max response, UTF-8 charset.

Definitions
connectTimeoutstring

Maximum time to establish the connection before failing; unset uses the client default.

connectionPoolIdleTimeoutstring
DefaultPT0S

Idle timeout for pooled connections; defaults to 0s.

defaultCharsetstring
DefaultUTF-8

Request charset; defaults to UTF-8.

headersobject

HTTP headers

HTTP headers to include in the request

maxContentLengthintegerstring
Default10485760

Maximum response size; defaults to 10 MB.

readIdleTimeoutstring
DefaultPT5M

Idle time allowed while reading before closing the connection; defaults to 5m.

readTimeoutstring
DefaultPT10S

Maximum read duration before failing; defaults to 10s.

Possible Values
HTMLMARKDOWNV2

Telegram Bot parse-Mode

Optional formatting mode for message text or a document caption. Use the case-sensitive enum names HTML or MARKDOWNV2 (values sent to Telegram are HTML and MarkdownV2). Default sends plain text.

Message payload

Message text sent as Telegram sendMessage text when from is absent. Required for text messages. Do not wrap the value in a JSON object. For file uploads, use caption instead.