External signal external-signal

The External signal activity is a Flow control activity. It allows you to trigger the execution of a workflow from another workflow or from an API call.

NOTE
This page presents the main steps to configure an External Signal activity in Campaign Web User Interface and trigger it from another workflow or an API call. Detailed information on how to trigger a workflow and its best practices, and how to work with Campaign APIs is available in the Campaign v8 (client console) documentation

Follow these steps to configure the External signal activity and trigger its execution:

  1. Add an External signal activity into your workflow.

  2. Complete the configuration of your workflow and start its execution. The External Signal activity displays as “Pending”, waiting to be triggered.

  3. Retrieve the information below:

    • The workflow’s internal name, which displays next to its label.

      accordion
      View example
    • The External signal activity’s name, which displays in the workflow’s Execution options.

      accordion
      View example
  4. To trigger the workflow, you need to execute the PostEvent JavaScript function. This function allows you to pass variables with the values of your choice and leverage them in the triggered workflow.

    The PostEvent function can be executed either from another workflow, or from an API call.

    • To trigger an External signal activity from a workflow, execute the PostEvent function from the Initialization script pane, which is accessible from the activity’s Execution options. For the JavaScript code activity, execute the function from the activity’s script.

      The syntax is as follows:

      code language-none
      
      xtk.workflow.PostEvent("<workflow-internal-name>","<signal-activity-name>","",<variables <variable-name>="<value>"/>, false);
      
    accordion
    View example

    In this example, we are triggering the “signal1” External signal activity that has been added to the workflow whose internal name is “WKF12345”. We are also passing a variable named “customID”, with the value “123456”.

recommendation-more-help
c39c2d00-ba9a-424b-adf9-66af58a0c34b