telegram.bot.enable-webhook
Register a public HTTPS URL as the Telegram webhook and persist the webhook config (URL + secret_token) on the TelegramBot row (bot_uuid, webhook_url, previous_webhook_url, ok)
End-to-end webhook enablement for a Telegram bot.
Calls Telegram setWebhook to register the public HTTPS URL (Layer 1), then persists the webhook_url and secret_token on the TelegramBot row so the api-core receiver can verify incoming updates (Layer 2).
Overview
| Property | Value |
|---|---|
| Workflow type | Dag |
| 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 call setWebhook and whose webhook_url will be updated. |
webhook_url | string | Yes | — | Public HTTPS URL where Telegram will POST update events, e.g. https://orkestia.ltinteg.local/api/telegram/webhook/<signed_bot_uuid>. Must begin with https://. |
secret_token | string | No | — | Optional secret token (1-256 chars, [A-Za-z0-9_-]) that Telegram includes in the X-Telegram-Bot-Api-Secret-Token header on every webhook call so the receiver can verify the call's origin. Stored as TelegramBot.webhook_secret. Recommended. |
allowed_updates | json | No | — | Optional list of update types to receive, e.g. ['message', 'callback_query']. If null or empty, Telegram sends all types except chat_member and chat_join_request. |
drop_pending_updates | boolean | No | — | If true, Telegram drops any queued updates from the polling era before activating webhook mode. Useful when switching from long-polling. |
workflow_run_uuid | string | No | — | Engine-stamped parent run uuid (DAG step target) |
Output Schema
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
bot_uuid | uuid | No | — | UUID of the TelegramBot row (echoed from input via Layer 2) |
webhook_url | string | No | — | The webhook URL now active on the bot (from Layer 2) |
previous_webhook_url | string | No | — | The webhook URL that was on the row before this call. Equals webhook_url when the action was a no-op (already matched). Null when no webhook was previously configured. |
ok | boolean | No | — | True when Telegram accepted the setWebhook call (from Layer 1). Always true on the success path. |
set_webhook | json | No | — | Result dict from the set_webhook step (Layer 1) |
update_webhook_config | json | No | — | Result dict from the update_webhook_config step (Layer 2) |
secret_token | string | No | — | Echoed from input |
allowed_updates | json | No | — | Echoed from input |
drop_pending_updates | boolean | No | — | Echoed from input |
workflow_run_uuid | string | No | — | DAG run uuid; stamped by the engine's auto-generated 'start' transition |
completed_at | string | No | — | — |
failed_at | string | No | — | — |
failure_reason | string | No | — | Engine-stamped human-readable failure reason |
failed_at_state | string | No | — | Engine-stamped state when the workflow failed |
failed_step | string | No | — | Engine-stamped step name (DAG path) |
failed_layer | integer | No | — | Engine-stamped layer index (DAG path) |
error | string | No | — | Engine-stamped exception message |
error_type | string | No | — | Engine-stamped exception class name |
DAG Layers
| # | Layer | Steps | Compensation |
|---|---|---|---|
| 1 | set_webhook | telegram.bot.set-webhook | — |
| 2 | update_config | data.telegram.bot.update-webhook-config | — |
Execution Flow
Sub-workflows
| Sub-workflow | Step name |
|---|---|
telegram.bot.set-webhook | set_webhook |
data.telegram.bot.update-webhook-config | update_webhook_config |
API Usage
bash
POST /api/workflows/start
Content-Type: application/json
{
"workflow_type": "telegram.bot.enable-webhook",
"initial_data": {
"bot_uuid": "value",
"webhook_url": "value"
}
}