ContentRunner Bot Upsert
AI-generatedSummary
Insert or update a bot record in the PostgreSQL bots table, using its Telegram bot ID as the conflict key. Connect a Content Runner PostgreSQL credential and provide the bot ID; the operation returns the inserted or updated row.
Inputs
- Telegram Bot ID (required) — Bot identifier, trimmed and converted to a string. Defaults to
botId,bot.id, orbot.external_idfrom the incoming item. - Bot Username — Username to store; defaults to
bot.nameorbot_usernamefrom the incoming item. If omitted, preserves the existing username on update. - Is Active — Whether the bot is active; defaults to
true. Setsis_activeon insert or update. - Content Runner PostgreSQL credential (required) — Provides the database connection used to write the bot record.
Output shape
A list of items, one per input item, each containing the returned database row.
On a matching
tg_bot_id, updatesis_activeand updatesbot_usernameonly when a username is supplied. If Continue On Fail is enabled, an item with a missing bot ID or another per-item error returns{ "error": "..." }instead of a row.
Examples
Example 1: Insert a bot
Set tgBotId to a bot identifier and optionally provide botUsername and isActive.
Example 2: Update an existing bot
Use the existing tgBotId; the operation updates its active status and replaces the username only if a nonempty username is provided.