Skip to content
Proud to collaborate with Microsoft for Startups

telegram.update.dispatch ​

Process one inbound Telegram Update payload received via webhook. Persists the event idempotently via data.telegram.update-event.persist and inline-acknowledges any callback_query so the user's Telegram client stops showing the loading spinner. Ack failure does not fail the workflow — callback_acked=False is returned instead.

Handle one inbound Telegram Update payload from the webhook route.

PENDING (auto_advance=execute) → COMPLETED with event_uuid + ack result ↘ FAILED on bot-not-found, malformed payload, or persist failure

Overview ​

PropertyValue
Workflow typeAtomic
LibraryApp-telegram
Version1.0

Input Schema ​

FieldTypeRequiredDefaultDescription
bot_uuiduuidYes—UUID of the TelegramBot row that received this update.
payloadjsonYes—Raw Telegram Update JSON dict as POSTed by the webhook. Must contain at least update_id (required by the Telegram protocol).

Output Schema ​

FieldTypeRequiredDefaultDescription
event_uuiduuidYes—UUID of the persisted TelegramWebhookEvent row.
already_existsbooleanYes—True if the (bot, update_id) pair was already in the database (idempotency hit).
update_typestringYes—Derived update type, e.g. 'message', 'callback_query', 'channel_post'. 'unknown' if none of the known keys are present in the payload.
update_refintegerYes—Telegram's integer update reference from the payload.
chat_refintegerNo—Chat ID derived from the payload; None for inline_query, chosen_inline_result, and any type where a chat context is absent.
callback_ackedbooleanYes—True if this update was a callback_query AND the answerCallbackQuery call succeeded. False if not a callback_query, or if the ack failed (failure is soft — does not fail the dispatch).
callback_dispatchedbooleanNo—True when compact callback_data routed to a workflow callback.
callback_workflowstringNo—Workflow type selected from compact callback_data.
callback_actionstringNo—Compact callback action key selected from callback_data.
callback_errorstringNo—Soft callback dispatch error, if any.
errorstringNo—Engine-captured exception message.
error_typestringNo—Exception class name.
failed_at_statestringNo—State name where the failure was recorded.
failed_layerstringNo—DAG layer name (N/A for linear workflows).
failed_stepstringNo—DAG step name (N/A for linear workflows).
failure_reasonstringNo—Human-readable reason the workflow failed.
failure_typestringNo—Failure category.
failed_actionstringNo—Name of the action method that raised.
bot_uuiduuidNo—bot_uuid echoed from input on failure.

States ​

StateInitialTerminalSuccessAuto-advanceDescription
pendingYesNo—executeParse, persist, and optionally ack the inbound Telegram update
completedNoYesYes—Update persisted; callback_query ack'd if applicable
failedNoYesNo—Dispatch failed due to bot not found, malformed payload, or persist error

State Diagram ​

Transitions ​

FromActionToDescription
pendingexecutecompleted—
* (any state)failfailed—

API Usage ​

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

{
  "workflow_type": "telegram.update.dispatch",
  "initial_data": {
    "bot_uuid": "value",
    "payload": "value"
  }
}