ContentRunner Set Blocked icon

ContentRunner Set Blocked

Update only blocked_at in user_bot_interactions by tg_chat_id + tg_bot_id or user_id + bot_id

ContentRunner Set Blocked

AI-generated

Summary

Sets blocked_at on the most recently joined matching user–bot interaction in PostgreSQL. Optionally limits the match to a campaign and, when Customer.io credentials are configured, asynchronously sends Telegram blocked status and interaction attributes to Customer.io.

Inputs

  • Identify By (required) — Choose tg_chat_id + tg_bot_id or the user_id + bot_id UUID pair to find the interaction.
  • Telegram Chat ID (required) — Used with Telegram Bot ID when identifying by Telegram IDs. The default expression checks parsed.from_id, parsed.chat_id, then tg_chat_id on the input item.
  • Telegram Bot ID (required) — Used with Telegram Chat ID. The default expression checks botId, bot.id, then bot.external_id on the input item.
  • User ID (required) — Used with Bot ID when identifying by UUID. Defaults to the input item's user_id.
  • Bot ID (required) — Used with User ID when identifying by UUID. Defaults to the input item's bot_id.
  • Campaign ID — Optional campaign UUID to restrict the interaction lookup. If omitted, the most recently joined matching interaction is selected.
  • Blocked At (required) — Timestamp to store. NOW() or an empty value is converted to the current time; otherwise the supplied value is cast to a PostgreSQL timestamptz. Defaults to NOW().

Output shape

One output item per input item, containing the updated database row on success.

Requires ContentRunner PostgreSQL credentials. Lookup failures throw unless Continue On Fail is enabled, in which case an error object is returned for that input. If optional Customer.io credentials are present and a Telegram chat ID is available, the node sends an identify request with telegram_blocked: true and related interaction attributes; this request runs asynchronously and its errors are ignored.

Links

Discussion