ContentRunner Campaign Upsert (Stage) icon

ContentRunner Campaign Upsert (Stage)

Find campaign linked to user+bot in user_bot_interactions and update it with Strapi params (strapi_campaign_id, strapi_segment_id, welcome_template_id, main_template_id). Campaign is created at Link time with empty fields.

ContentRunner Campaign Upsert (Stage)

AI-generated

Summary

Upsert a Strapi campaign linked to a user+bot pair by querying user_bot_interactions and updating campaign fields.

Inputs

  • identifyBy — Method to locate the user+bot pair; either 'tg' (Telegram chat_id+bot_id) or 'uuid' (user_id+bio_id).
  • tgChatId (required) — Telegram chat ID (used when identifyBy = tg).
  • tgBotId (required) — Telegram bot ID (used when identifyBy = tg).
  • userId (required) — User ID (used when identifyBy = uuid).
  • botId (required) — Bot ID (used when identifyBy = uuid).
  • strapiCampaignId — Strapi campaign identifier to set on the campaign.
  • strapiSegmentId — Strapi segment identifier to set on the campaign.
  • welcomeTemplateId — Welcome template identifier to set on the campaign.
  • mainTemplateId — Main template identifier to set on the campaign.

Output shape

Array of items; each item contains a json property with either the updated campaign row or an error object.

When continueOnFail is true, errors are returned as items; otherwise the operation throws and no result is returned.

Examples

Example 1: Update campaign for a Telegram user using chat and bot IDs.

identifyBy = tg, tgChatId = 12345, tgBotId = 67890, optional fields may be filled.

Example 2: Upsert campaign for a UUID user using user_id and bot_id.

identifyBy = uuid, userId = 111, botId = 222, optional fields may be filled.

Links

Discussion