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 ​
| Property | Value |
|---|---|
| Workflow type | Atomic |
| Library | App-telegram |
| Version | 1.0 |
Input Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
bot_uuid | uuid | Yes | — | UUID of the TelegramBot row whose token will be used to send the photo. The workflow resolves bot_uuid → bot_token internally. |
chat_ref | integer | Yes | — | Telegram integer chat reference. Negative for groups/channels (e.g. -100123456), positive for private chats. |
photo | string | Yes | — | URL of the photo to send, or a file reference Telegram already has. Both are accepted by sendPhoto. |
caption | string | No | — | Optional caption text displayed under the photo (max 1024 chars). |
parse_mode | string | No | — | Optional Telegram parse mode for the caption. Accepted values: 'MarkdownV2', 'HTML'. |
reply_markup | json | No | — | 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_id | string | No | — | Engine-stamped parent run id (DAG step target) |
Output Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
telegram_message_ref | integer | Yes | — | Telegram's integer message reference from the sendPhoto response. |
chat_ref | integer | Yes | — | Telegram integer chat reference the photo was sent to (echo of input). |
chat_type | string | Yes | — | Chat type from the response ('private', 'group', 'supergroup', 'channel'). |
chat_title | string | No | — | Chat title from the response; None for private chats. |
chat_username | string | No | — | Chat @username from the response; None when not set. |
date | integer | Yes | — | Telegram unix timestamp (int) for when the photo was sent. |
photo_file_ref | string | No | — | 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_reason | string | No | — | Engine-stamped human-readable failure reason |
failure_type | string | No | — | Engine-stamped failure category |
failed_action | string | No | — | Engine-stamped action that raised |
failed_at_state | string | No | — | Engine-stamped state when the workflow failed |
failed_step | string | No | — | Engine-stamped step name (DAG path) |
failed_layer | string | No | — | Engine-stamped layer index (DAG path) |
error | string | No | — | Engine-stamped exception message |
error_type | string | No | — | Engine-stamped exception class name |
States ​
| State | Initial | Terminal | Success | Auto-advance | Description |
|---|---|---|---|---|---|
pending | Yes | No | — | execute | Send photo via Telegram Bot API |
completed | No | Yes | Yes | — | Photo sent; metadata captured |
failed | No | Yes | No | — | Photo send failed |
State Diagram ​
Transitions ​
| From | Action | To | Description |
|---|---|---|---|
pending | execute | completed | — |
* (any state) | fail | failed | — |
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"
}
}