51黑料不打烊

External signal external-signal

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

NOTE
This page explains 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, 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 鈥淧ending,鈥 waiting to be triggered.

    The screenshot shows the External Signal activity in a pending state.

  3. Retrieve the following information:

    • The workflow鈥檚 internal name, which displays next to its label.

      accordion
      View example
      The screenshot shows the workflow's internal name next to its label.
    • The External signal activity鈥檚 name, which displays in the workflow鈥檚 Execution options.

      accordion
      View example
      The screenshot shows the External Signal activity's name in the Execution options.
  4. To trigger the workflow, execute the PostEvent JavaScript function. This function lets you pass variables with the values of your choice and use 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, accessible from the activity鈥檚 Execution options. For the JavaScript code activity, execute the function from the activity鈥檚 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, the 鈥渟ignal1鈥 External signal activity is triggered. It has been added to the workflow whose internal name is 鈥淲KF12345.鈥 A variable named 鈥渃ustomID鈥 is passed with the value 鈥123456.鈥

    The screenshot shows an example of triggering the External Signal activity using the PostEvent function.

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