ContentRunner Interaction icon

ContentRunner Interaction

Link user+bot (creates empty campaign), Get state, or Update state

Link

AI-generated

Summary

Links a Telegram user and bot in the ContentRunner PostgreSQL database, upserting their details and creating or reusing a campaign and user-bot interaction. If the optional Customer.io credentials are configured, it also sends a person identify request asynchronously.

Inputs

  • Telegram Chat ID (required) — Telegram user chat ID; defaults from parsed.from_id, parsed.chat_id, or tg_chat_id.
  • Telegram Bot ID (required) — Telegram bot ID; defaults from botId, bot.id, or bot.external_id.
  • User First Name — Optional first name, defaulted from parsed.from_first_name or first_name.
  • User Last Name — Optional last name, defaulted from parsed.from_last_name or last_name.
  • User Username — Optional Telegram username, defaulted from parsed.from_username or tg_username.
  • User Language Code — Optional language code, defaulted from parsed.from_language_code or language_code.
  • User Shared Contact — Optional shared phone contact, defaulted from parsed.contact_phone_number or shared_contact.
  • Bot Username — Optional bot username, defaulted from bot.name or bot_username.
  • Strapi Campaign ID — Optional Strapi campaign documentId. Reuses the matching campaign; otherwise creates a campaign with a generated local ID.
  • Channel ID — Optional channel or chat ID to associate with the interaction; defaults from channel.external_id, parsed.chat_id, or channel_id.
  • Channel Title — Optional channel or chat title to store; defaults from channel.title, parsed.chat_title, or chat_title.
  • Channel Type — Optional chat type to store, such as private, group, supergroup, or channel; defaults from channel.chat_type, parsed.chat_type, or chat_type.

Output shape

One item per input item, containing the database interaction row plus user_id, bot_id, and campaign_id.

Existing user and bot records are updated with supplied nonempty details; an existing interaction for that user and bot is returned without creating a new campaign or interaction. Channel data is stored only when a channel ID is supplied. Requires ContentRunner PostgreSQL credentials. Errors can be emitted as {"error": ...} when Continue On Fail is enabled.

Links

Discussion