ContentRunner User Upsert icon

ContentRunner User Upsert

Insert or update a user in n8n_content_runner by tg_chat_id (from Telegram parsed: from_id, chat_id)

ContentRunner User Upsert

AI-generated

Summary

Insert or update a user in the PostgreSQL users table, using Telegram chat ID as the conflict key. If Customer.io credentials are configured, also send a person identify request without waiting for its result.

Inputs

  • Telegram Chat ID (required) — Unique chat ID; defaults to parsed.from_id, then parsed.chat_id, then tg_chat_id from the input item.
  • Username — Telegram username; defaults to parsed.from_username or tg_username.
  • First Name — Defaults to parsed.from_first_name or first_name.
  • Last Name — Defaults to parsed.from_last_name or last_name.
  • Language Code — User language, such as en or ru; defaults to parsed.from_language_code or language_code.
  • Shared Contact — Phone number from a shared contact; defaults to parsed.contact_phone_number or shared_contact.

Output shape

One item per input item, containing the inserted or updated database row.

On conflict for tg_chat_id, non-null supplied profile values update the existing row; missing values preserve stored values. Requires Content Runner PostgreSQL credentials. Customer.io tracking is optional; when configured, the node identifies tg_<Telegram user ID> using parsed.from_id, then from_id, then the chat ID, and sends username, phone, and Telegram ID attributes. With Continue On Fail enabled, item errors are returned as { "error": "..." } items.

Links

Discussion