Telegram Action
telegram_action · Nodes · Providers
Runs Telegram bot actions.
Telegram Action#
Runs Telegram bot actions from one node. The send_message operation shares the same send semantics as Telegram Send, including attachment support.
Configuration#
connection — Telegram bot connection (ULID). Use the returned connection ID. Must be a telegram_bot connection type. Empty or malformed values fail validation: Telegram bot connection is required or expected ULID connection id.
operation — action to run:
send_messagesend_chat_actionanswer_callback_queryedit_message_textedit_message_reply_markupdelete_messageset_message_reaction
String fields support workflow interpolation such as {{ input.chat_id }}.
retry — Whether a request is sent again after a failure that passes: a rate limit, a busy server, a dropped connection. Off by default; see Retries for how attempts and waits work. Every operation is a write, sent again only when Telegram refused it before acting: the connection never opened, or Telegram answered 425 or 429. send_message uploads of photos, voice and documents go once.
Operations#
send_message#
Fields:
chat_id— Chat ID (TextBlock). Resolves to a numeric chat ID. Must parse as an integer:chat_id must be an integer.text— Message text (TextBlock). Supports Telegram markdown and interpolation. Required for text-only sends:text is required when attachments are empty. Optional when attachments are present.reply_to_message_id— Optional message ID to reply to (literal integer).reply_markup— Optional Telegram reply markup JSON object (TextBlock). Supports interpolation. Only valid for text-only sends; attachments plus reply_markup fails withreply_markup cannot be used with Telegram attachments.attachments— Attachment binding expression (TextBlock). Interpolates exactly to a direct runtime binary, binary wrapper{ binary, filename?, content_type?, caption? }, media reference wrapper{ object_id, filename?, caption? }, or a flat array of those. JSON string config accepts media references only. Wrapper/media-referencecaptionis retained for that attachment and overridestext.
Attachment send behavior mirrors telegram_send:
- Text is optional when attachments are present.
- Text becomes the first attachment's caption unless that attachment has its own
caption. image/*content type → photo;audio/oggor.oggfilename → voice; everything else → document.reply_markupplus attachments is rejected before sending.
send_chat_action#
Fields:
chat_idaction
Actions:
typingupload_photorecord_videoupload_videorecord_voiceupload_voiceupload_documentchoose_sticker
answer_callback_query#
Fields:
callback_query_idtextshow_alert
edit_message_text#
Fields:
chat_idmessage_idtextreply_markup
edit_message_reply_markup#
Fields:
chat_idmessage_idreply_markup
Empty reply_markup clears the message reply markup.
delete_message#
Fields:
chat_idmessage_id
set_message_reaction#
Fields:
chat_idmessage_idreactionis_big
Reaction kinds:
emojiwithemojicustom_emojiwithcustom_emoji_idpaidclear
Inputs#
input is any upstream JSON payload used for interpolation.
Examples:
{{ input.chat_id }}{{ input.message.message_id }}{{ input.callback_query.id }}
Outputs#
output wraps the operation result:
{
"success": true,
"operation": "delete_message",
"result": { "ok": true }
}
send_message returns sent message details under result:
{
"success": true,
"operation": "send_message",
"result": {
"message_id": 123,
"chat_id": -100123,
"text": "Hello",
"sent_at": 1704067200,
"attachments": [],
"messages": []
}
}
When attachments are present, send_message result includes attachments and messages arrays:
{
"success": true,
"operation": "send_message",
"result": {
"message_id": 123,
"chat_id": -100123,
"text": "",
"sent_at": 1704067200,
"attachments": [
{ "message_id": 123, "chat_id": -100123, "attachment_type": "photo", "filename": "chart.png" }
],
"messages": [
{ "provider": "telegram", "message_id": 123, "chat_id": -100123, "filename": "chart.png", "attachment_type": "photo" }
]
}
}
Fields in result:
message_id— Telegram message ID of the first message sentchat_id— Chat where message was senttext— Message text or resolved captionsent_at— Unix timestamp when sentattachments— Array of sent attachment summaries. Each hasmessage_id,chat_id,attachment_type(one ofphoto,voice,document),filename, and optionalcontent_type.messages— Array of per-message Telegram results. Each hasprovider,message_id,chat_id, optionalfilename, and optionalattachment_type.
Runtime Errors#
| Error | Cause | Remediation |
|---|---|---|
Telegram bot connection is required |
Connection field is empty | Select a Telegram bot connection from Settings → Connections |
expected ULID connection id |
Connection field contains a malformed value | Select a valid connection from Settings → Connections |
chat_id must be an integer |
Chat ID resolved to a non-integer value | Ensure chat_id config resolves to a numeric chat ID |
text is required when attachments are empty |
Text is empty and no attachments configured on send_message | Provide text or configure attachments |
reply_markup cannot be used with Telegram attachments |
Both reply_markup and attachments configured on send_message | Send a text keyboard message separately or omit reply_markup |
expected ULID media object id |
A object_id in the attachment value is not a valid ULID |
Check the media object ID came from a media-producing node |
Failed to resolve media object |
object_id does not exist or is inaccessible |
Check the media object ID came from the same workspace |
| Telegram API error | Bot lacks permission, chat not found, or API error | Check bot permissions and chat membership |
Inputs
inputRequired
Outputs
output
Configuration
| Field | Type | Required | Description |
|---|---|---|---|
connection | connection(telegram_bot) | Yes | |
operation | tagged_union | No | |
retry | tagged_union | No | Sends a request again after a failure that passes: a rate limit, a busy server, a dropped connection. Off sends once. |
base_config | record | No | Shared node configuration. failure_mode decides what a failure of this node does to the workflow; leave it at the default stop unless the workflow handles the failure itself on the node's error output (route_to_error) or the node is a rare emergency kill switch (stop_workflow). |