data.telegram.bot.update-webhook-config
Persist the outcome of a Telegram setWebhook/deleteWebhook call by updating webhook_url and webhook_secret on the TelegramBot row identified by bot_uuid. Pass webhook_url=null to clear (disable). Idempotent on matching values.
Update webhook_url and webhook_secret on an existing TelegramBot row.
Pass webhook_url=<url> (enable / reconfigure) or webhook_url=None (disable). Idempotent: if both fields already match the stored values the row is not mutated and the action still returns SUCCESS.
Called internally by telegram.bot.enable-webhook and telegram.bot.disable-webhook DAGs after the Telegram API call succeeds.
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 to update. Resolved internally to the integer FK; never exposed outward. |
webhook_url | string | Yes | — | New webhook URL to set on the TelegramBot row. Pass the HTTPS URL when enabling; pass null when disabling. The field is required (not optional) so the caller must be explicit about intent — a missing field is an authoring error. |
webhook_secret | string | No | — | Optional secret_token for Telegram's X-Telegram-Bot-Api-Secret-Token header. Pass the secret when enabling so the api-core webhook receiver can verify origin. Pass null when disabling. |
workflow_run_id | string | No | — | Engine-stamped parent run id (DAG step target) |
Output Schema
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
bot_uuid | uuid | Yes | — | UUID of the updated TelegramBot row (echoed from input). |
webhook_url | string | No | — | The new webhook_url value now stored on the row (may be null). |
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 (values already matched). |
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 | — | complete | Update webhook config on TelegramBot row |
completed | No | Yes | Yes | — | Webhook config updated (or already matched — no-op) |
failed | No | Yes | No | — | Webhook config update failed |
State Diagram
Transitions
| From | Action | To | Description |
|---|---|---|---|
pending | complete | completed | — |
pending | fail | failed | — |
API Usage
bash
POST /api/workflows/start
Content-Type: application/json
{
"workflow_type": "data.telegram.bot.update-webhook-config",
"initial_data": {
"bot_uuid": "value",
"webhook_url": "value"
}
}