Skip to content
Proud to collaborate with Microsoft for Startups

data.telegram.bot.persist ​

Create or restore a TelegramBot row, keyed on (organization_uuid, bot_ref)

Idempotently insert or restore a TelegramBot row.

Accepts organization_uuid and resolves it to the internal integer FK before any DB operation, following the platform UUID-only surface rule.

Keyed on (organization_id, bot_id). Three cases:

  • not found → INSERT, persisted=True restored=False
  • found, active → no-op row, refresh token/username/first_name, persisted=False restored=False
  • found, deleted → restore + refresh, persisted=False restored=True

Overview ​

PropertyValue
Workflow typeAtomic
LibraryApp-telegram
Version1.0

Input Schema ​

FieldTypeRequiredDefaultDescription
organization_uuiduuidYes—UUID of the organization that owns the bot
bot_tokenstringYes—Telegram Bot API token issued by BotFather
bot_refintegerYes—Telegram integer bot reference returned by getMe
usernamestringYes—Bot @username (without @), returned by getMe
first_namestringNo—Display name of the bot, returned by getMe
workflow_run_idstringNo—Engine-stamped parent run id (DAG step target)

Output Schema ​

FieldTypeRequiredDefaultDescription
bot_uuidstringYes—UUID of the persisted TelegramBot row
persistedbooleanYes—True when a brand-new row was inserted
restoredbooleanYes—True when a soft-deleted row was undeleted
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—completePersist Telegram bot row
completedNoYesYes—Bot row persisted
failedNoYesNo—Persist failed

State Diagram ​

Transitions ​

FromActionToDescription
pendingcompletecompleted—
pendingfailfailed—

API Usage ​

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

{
  "workflow_type": "data.telegram.bot.persist",
  "initial_data": {
    "organization_uuid": "value",
    "bot_token": "value",
    "bot_ref": 123,
    "username": "value"
  }
}