telegram.bot.register ​
Validate a Telegram bot token and persist the bot record (bot_uuid, bot_ref, username, persisted, restored)
End-to-end registration of a Telegram bot.
Validates the supplied bot token via Telegram getMe (Layer 1), then persists a TelegramBot row in the database (Layer 2).
Overview ​
| Property | Value |
|---|---|
| Workflow type | Dag |
| Library | App-telegram |
| Version | 1.0 |
Input Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
organization_uuid | uuid | Yes | — | UUID of the organization that owns the bot |
bot_token | string | Yes | — | Telegram Bot API token issued by BotFather (format: <bot_id>:<token_secret>) |
workflow_run_uuid | string | No | — | Engine-stamped parent run uuid (DAG step target) |
Output Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
bot_uuid | string | No | — | UUID of the persisted TelegramBot row (from Layer 2) |
bot_ref | integer | No | — | Telegram integer bot ID returned by getMe (from Layer 1) |
username | string | No | — | Bot @username (without @) returned by getMe (from Layer 1) |
persisted | boolean | No | — | True when a brand-new TelegramBot row was inserted |
restored | boolean | No | — | True when a soft-deleted TelegramBot row was undeleted |
validate_token | json | No | — | Result dict from the validate_token step (Layer 1) |
persist_bot | json | No | — | Result dict from the persist_bot step (Layer 2) |
organization_uuid | uuid | No | — | Echoed from input |
bot_token | string | 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 | validate | telegram.bot.validate-token | — |
| 2 | persist | data.telegram.bot.persist | — |
Execution Flow ​
Sub-workflows ​
| Sub-workflow | Step name |
|---|---|
telegram.bot.validate-token | validate_token |
data.telegram.bot.persist | persist_bot |
API Usage ​
bash
POST /api/workflows/start
Content-Type: application/json
{
"workflow_type": "telegram.bot.register",
"initial_data": {
"organization_uuid": "value",
"bot_token": "value"
}
}