telegram.callback.answer-api
Acknowledge a Telegram inline keyboard button press via answerCallbackQuery. Input takes bot_uuid; the token is resolved from the TelegramBot row internally. Without this call, the user's client shows a loading spinner indefinitely.
Call Telegram answerCallbackQuery for a bot identified by bot_uuid.
PENDING (auto_advance=execute) → COMPLETED with acknowledgement result ↘ FAILED on any error
Single-responsibility: one API call, no DB writes. Acknowledges a callback_query so the user's Telegram client stops showing a loading spinner on the pressed inline keyboard button.
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 answer the callback. The workflow resolves bot_uuid → bot_token internally. |
callback_query_ref | string | Yes | — | Telegram's string identifier for the callback query, taken from the callback_query.id field of the inbound update. Telegram only accepts answers within ~10 minutes of the button press. |
text | string | No | — | Optional notification text shown to the user (max 200 characters). If null, the loading spinner disappears silently. |
show_alert | boolean | No | — | If true, Telegram pops a modal alert dialog instead of an inline toast. Defaults to false. |
url | string | No | — | URL that will be opened by the user's client. Used only for Game or LoginUrl buttons — not relevant for typical callback_data buttons. |
cache_time | integer | No | — | Time in seconds that the result of the callback query may be cached client-side. Telegram defaults to 0. |
Output Schema
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
ok | boolean | Yes | — | True when Telegram accepted the answerCallbackQuery call. Telegram's API always returns true on success for this method. |
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 | Acknowledge callback query via Telegram Bot API |
completed | No | Yes | Yes | — | Callback query acknowledged; Telegram confirmed ok=true |
failed | No | Yes | No | — | Callback query acknowledgement 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.callback.answer-api",
"initial_data": {
"bot_uuid": "value",
"callback_query_ref": "value"
}
}