Skip to content
Proud to collaborate with Microsoft for Startups

telegram.message.send-photo-api ​

Send a photo via Telegram Bot API (sendPhoto) and return message metadata. Input takes bot_uuid; the token is resolved from the TelegramBot row internally.

Call Telegram sendPhoto for a bot identified by bot_uuid.

PENDING (auto_advance=execute) → COMPLETED with message metadata ↘ FAILED on any error

Single-responsibility: one API call, no DB writes. The wrapping DAG (telegram.message.send-photo) is responsible for resolving the chat, persisting the message, and composing the result.

Overview ​

PropertyValue
Workflow typeAtomic
LibraryApp-telegram
Version1.0

Input Schema ​

FieldTypeRequiredDefaultDescription
bot_uuiduuidYes—UUID of the TelegramBot row whose token will be used to send the photo. The workflow resolves bot_uuid → bot_token internally.
chat_refintegerYes—Telegram integer chat reference. Negative for groups/channels (e.g. -100123456), positive for private chats.
photostringYes—URL of the photo to send, or a file reference Telegram already has. Both are accepted by sendPhoto.
captionstringNo—Optional caption text displayed under the photo (max 1024 chars).
parse_modestringNo—Optional Telegram parse mode for the caption. Accepted values: 'MarkdownV2', 'HTML'.
reply_markupjsonNo—Raw Telegram reply_markup dict, e.g. {"inline_keyboard": [[{"text": "OK", "callback_data": "ok"}]]}. Passed through to Bot.send_photo(reply_markup=...). Only the inline_keyboard key is supported; other shapes are passed as None.
workflow_run_idstringNo—Engine-stamped parent run id (DAG step target)

Output Schema ​

FieldTypeRequiredDefaultDescription
telegram_message_refintegerYes—Telegram's integer message reference from the sendPhoto response.
chat_refintegerYes—Telegram integer chat reference the photo was sent to (echo of input).
chat_typestringYes—Chat type from the response ('private', 'group', 'supergroup', 'channel').
chat_titlestringNo—Chat title from the response; None for private chats.
chat_usernamestringNo—Chat @username from the response; None when not set.
dateintegerYes—Telegram unix timestamp (int) for when the photo was sent.
photo_file_refstringNo—file reference Telegram assigned to the largest photo size in the response. Use this to re-send the same photo without re-uploading. Taken from message.photo[-1].file_id when the photo list is non-empty.
failure_reasonstringNo—Engine-stamped human-readable failure reason
failure_typestringNo—Engine-stamped failure category
failed_actionstringNo—Engine-stamped action that raised
failed_at_statestringNo—Engine-stamped state when the workflow failed
failed_stepstringNo—Engine-stamped step name (DAG path)
failed_layerstringNo—Engine-stamped layer index (DAG path)
errorstringNo—Engine-stamped exception message
error_typestringNo—Engine-stamped exception class name

States ​

StateInitialTerminalSuccessAuto-advanceDescription
pendingYesNo—executeSend photo via Telegram Bot API
completedNoYesYes—Photo sent; metadata captured
failedNoYesNo—Photo send failed

State Diagram ​

Transitions ​

FromActionToDescription
pendingexecutecompleted—
* (any state)failfailed—

API Usage ​

bash
POST /api/workflows/start
Content-Type: application/json

{
  "workflow_type": "telegram.message.send-photo-api",
  "initial_data": {
    "bot_uuid": "value",
    "chat_ref": 123,
    "photo": "value"
  }
}