Skip to content
Proud to collaborate with Microsoft for Startups

telegram.bot.set-webhook ​

Register a public HTTPS URL as the Telegram webhook for a bot identified by bot_uuid, or pass webhook_url='' to clear Telegram's current webhook. Wraps a single setWebhook API call; no DB writes. The bot token is resolved from the TelegramBot row internally.

Call Telegram setWebhook for a bot identified by bot_uuid.

PENDING (auto_advance=execute) → COMPLETED with ok + webhook_url echo ↘ FAILED on any error

Single-responsibility: one API call, no DB writes. The wrapping DAG (telegram.bot.enable-webhook) is responsible for persisting the webhook URL, updating the bot record, 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 call setWebhook. The workflow resolves bot_uuid → bot_token internally.
webhook_urlstringYes—Public HTTPS URL where Telegram will POST update events, e.g. https://orkestia.ltinteg.local/api/telegram/webhook/<signed_bot_uuid>. Pass the empty string to clear the current Telegram webhook without persisting local bot configuration.
secret_tokenstringNo—Optional secret token (1–256 chars, [A-Za-z0-9_-]) that Telegram will include in the X-Telegram-Bot-Api-Secret-Token header on every webhook request so the receiver can verify the call's origin. Recommended.
allowed_updatesjsonNo—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_updatesbooleanNo—If true, Telegram drops any queued updates from the polling era before activating webhook mode. Useful when switching from long-polling. Defaults to false.
max_connectionsintegerNo—Maximum number of parallel HTTPS connections Telegram will open to the webhook endpoint (1–100, Telegram default 40).
workflow_run_idstringNo—Engine-stamped parent run id (DAG step target)

Output Schema ​

FieldTypeRequiredDefaultDescription
okbooleanYes—True when Telegram accepted the setWebhook call. Telegram's API always returns true on success for this method.
webhook_urlstringYes—Echo of the URL that was registered as the webhook.
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—executeRegister webhook URL via Telegram Bot API
completedNoYesYes—Webhook registered; Telegram confirmed ok=true
failedNoYesNo—Webhook registration failed

State Diagram ​

Transitions ​

FromActionToDescription
pendingexecutecompleted—
* (any state)failfailed—

API Usage ​

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

{
  "workflow_type": "telegram.bot.set-webhook",
  "initial_data": {
    "bot_uuid": "value",
    "webhook_url": "value"
  }
}