Skip to content
Last updated

Incremental Activation Workflow Templates

Incremental Activation is a Beta release. For more information, contact your Customer Success Representative.

This page provides ready-to-use workflow templates for common Incremental Activation scenarios. You can copy and paste these templates directly into your workflow editor and modify the parameters to suit your needs.

Table of Contents

Basic Template - Add New Profiles Only

This is the simplest configuration that sends only new profiles to your destination.

Use case: Building cumulative audiences without re-sending existing profiles.

timezone: "UTC"
_export:
  params:
    # Change this to match your TD site
    api_endpoint: "https://integrations-gateway.us01.treasuredata.com"

    # Set your unique identifier column
    id_key: "email"

    # Columns to check for changes (defaults to id_key if empty)
    delta_keys: []

    # Only send new profiles
    activation_mappings: [
      {
        "delta_status": "new",
        "connector_field": "mode",
        "connector_field_value": "append"
      }
    ]

# Fetch and execute incremental activation workflow
+fetch_incremental_activation_wf:
  http_call>: "${params.api_endpoint}/integration_workflow/workflows/incremental_activation/fetch"
  method: POST
  headers:
    - Authorization: ${secret:td.apikey}
    - Content-Type: "application/json"
  content_type_override: application/x-yaml
  content: |
    {
      "database": "${activation_actions_db}",
      "source_table": "${activation_actions_table}",
      "id_key": "${params.id_key}",
      "delta_keys": ${JSON.stringify(params.delta_keys)},
      "activation_mappings": ${JSON.stringify(params.activation_mappings)},
      "result_connection_settings": ${result_connection_settings},
      "result_connection_name": "${result_connection_name}"
    }
  retry: true

Snowflake - Add New and Updated Profiles

Send both new profiles and profiles with updated attributes to Snowflake.

Use case: Keep a Snowflake table synchronized with segment changes, including attribute updates.

timezone: "UTC"
_export:
  params:
    # API endpoint for US region
    api_endpoint: "https://integrations-gateway.us01.treasuredata.com"

    # Unique identifier
    id_key: "td_customer_id"

    # Track changes in these columns
    delta_keys: ["email", "subscription_status", "loyalty_tier"]

    # Send new and updated profiles
    activation_mappings: [
      {
        "delta_status": "new",
        "connector_field": "mode",
        "connector_field_value": "append"
      },
      {
        "delta_status": "updated",
        "connector_field": "mode",
        "connector_field_value": "append"
      }
    ]

# Fetch and execute incremental activation workflow
+fetch_incremental_activation_wf:
  http_call>: "${params.api_endpoint}/integration_workflow/workflows/incremental_activation/fetch"
  method: POST
  headers:
    - Authorization: ${secret:td.apikey}
    - Content-Type: "application/json"
  content_type_override: application/x-yaml
  content: |
    {
      "database": "${activation_actions_db}",
      "source_table": "${activation_actions_table}",
      "id_key": "${params.id_key}",
      "delta_keys": ${JSON.stringify(params.delta_keys)},
      "activation_mappings": ${JSON.stringify(params.activation_mappings)},
      "result_connection_settings": ${result_connection_settings},
      "result_connection_name": "${result_connection_name}"
    }
  retry: true

Snowflake - Full Sync (Add, Update, Remove)

Keep Snowflake perfectly synchronized by adding new profiles, updating changed profiles, and removing deleted profiles.

Use case: Maintain an exact replica of your segment in Snowflake, including removals for GDPR compliance.

timezone: "UTC"
_export:
  params:
    # API endpoint for US region
    api_endpoint: "https://integrations-gateway.us01.treasuredata.com"

    # Unique identifier
    id_key: "email"

    # Track changes in these columns
    delta_keys: ["first_name", "last_name", "city", "country", "subscription_tier"]

    # Full synchronization: add, update, and delete
    activation_mappings: [
      {
        "delta_status": "new",
        "connector_field": "mode",
        "connector_field_value": "append"
      },
      {
        "delta_status": "updated",
        "connector_field": "mode",
        "connector_field_value": "append"
      },
      {
        "delta_status": "deleted",
        "connector_field": "mode",
        "connector_field_value": "delete"
      }
    ]

# Fetch and execute incremental activation workflow
+fetch_incremental_activation_wf:
  http_call>: "${params.api_endpoint}/integration_workflow/workflows/incremental_activation/fetch"
  method: POST
  headers:
    - Authorization: ${secret:td.apikey}
    - Content-Type: "application/json"
  content_type_override: application/x-yaml
  content: |
    {
      "database": "${activation_actions_db}",
      "source_table": "${activation_actions_table}",
      "id_key": "${params.id_key}",
      "delta_keys": ${JSON.stringify(params.delta_keys)},
      "activation_mappings": ${JSON.stringify(params.activation_mappings)},
      "result_connection_settings": ${result_connection_settings},
      "result_connection_name": "${result_connection_name}"
    }
  retry: true

Braze - Add New Profiles Only

Send only new users to Braze to minimize data point consumption.

Use case: Reduce Braze data point costs by avoiding re-sends of existing profiles.

timezone: "UTC"
_export:
  params:
    # API endpoint for US region
    api_endpoint: "https://integrations-gateway.us01.treasuredata.com"

    # Braze external_id as unique identifier
    id_key: "external_id"

    # Only check for new profiles (don't track attribute changes)
    delta_keys: []

    # Append new profiles only
    activation_mappings: [
      {
        "delta_status": "new",
        "connector_field": "mode",
        "connector_field_value": "append"
      }
    ]

# Fetch and execute incremental activation workflow
+fetch_incremental_activation_wf:
  http_call>: "${params.api_endpoint}/integration_workflow/workflows/incremental_activation/fetch"
  method: POST
  headers:
    - Authorization: ${secret:td.apikey}
    - Content-Type: "application/json"
  content_type_override: application/x-yaml
  content: |
    {
      "database": "${activation_actions_db}",
      "source_table": "${activation_actions_table}",
      "id_key": "${params.id_key}",
      "delta_keys": ${JSON.stringify(params.delta_keys)},
      "activation_mappings": ${JSON.stringify(params.activation_mappings)},
      "result_connection_settings": ${result_connection_settings},
      "result_connection_name": "${result_connection_name}"
    }
  retry: true

Update Google Ads customer lists with new and changed profiles.

Use case: Keep Google Ads audiences fresh with new prospects and updated contact information.

timezone: "UTC"
_export:
  params:
    # API endpoint for US region
    api_endpoint: "https://integrations-gateway.us01.treasuredata.com"

    # Email as unique identifier (will be hashed by connector)
    id_key: "email"

    # Track email and phone changes
    delta_keys: ["email", "phone_number"]

    # Send new and updated profiles
    activation_mappings: [
      {
        "delta_status": "new",
        "connector_field": "mode",
        "connector_field_value": "append"
      },
      {
        "delta_status": "updated",
        "connector_field": "mode",
        "connector_field_value": "append"
      }
    ]

# Fetch and execute incremental activation workflow
+fetch_incremental_activation_wf:
  http_call>: "${params.api_endpoint}/integration_workflow/workflows/incremental_activation/fetch"
  method: POST
  headers:
    - Authorization: ${secret:td.apikey}
    - Content-Type: "application/json"
  content_type_override: application/x-yaml
  content: |
    {
      "database": "${activation_actions_db}",
      "source_table": "${activation_actions_table}",
      "id_key": "${params.id_key}",
      "delta_keys": ${JSON.stringify(params.delta_keys)},
      "activation_mappings": ${JSON.stringify(params.activation_mappings)},
      "result_connection_settings": ${result_connection_settings},
      "result_connection_name": "${result_connection_name}"
    }
  retry: true

Meta Custom Audiences - Full Sync

Keep Meta Custom Audiences perfectly synchronized by adding new users and removing those who no longer qualify.

Use case: Maintain accurate audience lists for Facebook/Instagram advertising with automatic removals.

timezone: "UTC"
_export:
  params:
    # API endpoint for US region
    api_endpoint: "https://integrations-gateway.us01.treasuredata.com"

    # Email as unique identifier
    id_key: "email"

    # Track changes in these attributes
    delta_keys: ["email", "phone_number", "country"]

    # Add new/updated profiles and remove deleted ones
    # Note: Check if your Meta connector uses "action" or "mode"
    activation_mappings: [
      {
        "delta_status": "new",
        "connector_field": "action",
        "connector_field_value": "add"
      },
      {
        "delta_status": "updated",
        "connector_field": "action",
        "connector_field_value": "add"
      },
      {
        "delta_status": "deleted",
        "connector_field": "action",
        "connector_field_value": "remove"
      }
    ]

# Fetch and execute incremental activation workflow
+fetch_incremental_activation_wf:
  http_call>: "${params.api_endpoint}/integration_workflow/workflows/incremental_activation/fetch"
  method: POST
  headers:
    - Authorization: ${secret:td.apikey}
    - Content-Type: "application/json"
  content_type_override: application/x-yaml
  content: |
    {
      "database": "${activation_actions_db}",
      "source_table": "${activation_actions_table}",
      "id_key": "${params.id_key}",
      "delta_keys": ${JSON.stringify(params.delta_keys)},
      "activation_mappings": ${JSON.stringify(params.activation_mappings)},
      "result_connection_settings": ${result_connection_settings},
      "result_connection_name": "${result_connection_name}"
    }
  retry: true

Salesforce Marketing Cloud - Replace Mode

Replace the entire list in Salesforce Marketing Cloud with the current segment, ensuring precision targeting.

Use case: When you need an exact match between your segment and SFMC data extension.

timezone: "UTC"
_export:
  params:
    # API endpoint for US region
    api_endpoint: "https://integrations-gateway.us01.treasuredata.com"

    # Subscriber Key as unique identifier
    id_key: "subscriber_key"

    # Track changes in subscription attributes
    delta_keys: ["email", "subscription_status", "preference_center"]

    # Replace mode: clear and reload with current data
    activation_mappings: [
      {
        "delta_status": "new",
        "connector_field": "mode",
        "connector_field_value": "replace"
      },
      {
        "delta_status": "updated",
        "connector_field": "mode",
        "connector_field_value": "replace"
      }
    ]

# Fetch and execute incremental activation workflow
+fetch_incremental_activation_wf:
  http_call>: "${params.api_endpoint}/integration_workflow/workflows/incremental_activation/fetch"
  method: POST
  headers:
    - Authorization: ${secret:td.apikey}
    - Content-Type: "application/json"
  content_type_override: application/x-yaml
  content: |
    {
      "database": "${activation_actions_db}",
      "source_table": "${activation_actions_table}",
      "id_key": "${params.id_key}",
      "delta_keys": ${JSON.stringify(params.delta_keys)},
      "activation_mappings": ${JSON.stringify(params.activation_mappings)},
      "result_connection_settings": ${result_connection_settings},
      "result_connection_name": "${result_connection_name}"
    }
  retry: true

How to Use These Templates

  1. Copy the template that matches your use case
  2. Create a new workflow in TD Data Workbench > Workflows
  3. Paste the template into the workflow editor
  4. Modify the parameters:
    • Set the correct api_endpoint for your TD site
    • Configure id_key to match your unique identifier column
    • Set delta_keys to the columns you want to track for changes
    • Adjust activation_mappings based on your connector's capabilities
  5. Save the workflow
  6. Assign it to an activation or run it as a standalone workflow

Parameter Customization Guide

API Endpoint by Region

RegionEndpoint
UShttps://integrations-gateway.us01.treasuredata.com
EUhttps://integrations-gateway.eu01.treasuredata.com
Asia Pacifichttps://integrations-gateway.ap02.treasuredata.com
Japanhttps://integrations-gateway.treasuredata.co.jp

Common ID Keys by Platform

PlatformRecommended ID KeyNotes
Brazeexternal_idMust match Braze's external_id field
Salesforce Marketing Cloudsubscriber_keySFMC's unique identifier
Google AdsemailWill be hashed by the connector
MetaemailWill be hashed by the connector
Snowflaketd_customer_id or emailChoose based on your data model

Connector Field Names

Different connectors use different field names:

ConnectorField NameSupported Values
Snowflake, MySQL, PostgreSQLmodeappend, replace, truncate, delete
Brazemodeappend, replace
Google Ads, Google Sheetsmodeappend, replace
Meta Custom Audiencesactionadd, remove
Klaviyooperationadd, remove

Next Steps