Step-2: Native Data-format

B1: Variables: Set Primitive Variable - Store webhook payload

The data and context passed by the external/third-party entity through the HTTP-request is not in a native Runbook format. The data and context must be converted into a native data format so the Runbook can properly process the data and context while the Runbook executes.

You can use the Variables: Set Primitive Variable node to parse data and context from the HTTP-request into Runbook runtime-variables. The Runbook runtime-variables persist for the duration of the Runbook execution. The automation can use these variables throughout the process.

The Variables: Set Primitive Variable node employs a Liquid template to define how to parse data and context out of the HTTP-request and into Runbook runtime-variables according to the Template defined in section “Template to Assign Value to Variables” of the Variables: Set Primitive Variable node.

PREREQUISITE:

Prior to configuring the Variables: Set Primitive Variable node, the Runbook runtime-variables intended to hold the HTTP-request data and context must first be configured.

Runbook runtime-variables are configured in the Runbook Editor by:

  1. Selecting the Variables menu-item (i.e. (x) ) (Edit the variables used in the Runbook) to open the Runbook Variable pop-up.

  2. In the Runbook Variable pop-up: for each data/context element in the HTTP-request that need to be processed by the Runbook:

    1. Under Runtime Scope, click Add a Runtime Variable to create a runtime variable (with appropriate Name, Type, Unit, and Default value) to describe/hold that element.

  3. When all data/context elements of interest in the HTTP-request have an associated runtime-variable: click “Save & Close”.

For example,

  • One data/context element in HTTP-request is:

    • { "alert_id": 1}

  • The associated Runbook runtime-variable for storing this information in native data-format is:

Placement of the Variables: Set Primitive Variable node in the Runbook Editor

There are two methods to place the Variables: Set Primitive Variable node in the canvas of the Runbook Editor.

  1. Find the Variables: Set Primitive Variable node in the palette on the left-side of the Runbook Editor and drag it onto the canvas to the right of the Triggering Entity: Webhook node.

    1. The Triggering Entity: Webhook node provides the data and context input for the Variables: Set Primitive Variable node. Connect the data flow from Triggering Entity: Webhook to Variables: Set Primitive Variable.

  2. Alternatively, click the plus sign on the Triggering Entity: Webhook node to reveal a pop-up menu of relevant nodes and find/select the Triggering Entity: Webhook node.

NOTE: this method automatically connects the data flow from Triggering Entity: Webhook to Variables: Set Primitive Variable.

Configuration of the Node to Parse data from HTTP-request into Runbook-runtime variables

PREREQUISITE: The Runbook runtime-variables must be defined before proceeding with this step. If the needed runtime-variables do not appear in the pick list, close the node editor card. You must define the needed runtime-variables.
NOTE: The node editor card takes a snapshot of the Runbook variables as defined at that point in time. If additional needed variables are defined after opening the node editor card you must exit and enter the node editor card to get the latest snapshot.
  1. In the Variables: Set Primitive Variable editor card on the right, go to the “Variables to Set” area and:

    1. Press “Set another Variable” to begin process of adding all of the predefined Runbook-runtime variables (defined to hold associated HTTP-request content) to this node:

      1. For each variable being added, ensure Scope: Runbook execution is selected.

      2. Then find the specific Variable Name.

    2. Repeat this process until every predefined Runbook runtime variable (defined to hold associated HTTP-request content) are added to this node.

  2. Next, the “Template to Assign Value to Variables” area must be configured.

    NOTE: This area of the node configuration uses Liquid-templates to define data formats. Refer to Working With Liquid Templates.
    1. This Webhook and its associated HTTP-request use the following Liquid template to map the HTTP-request content into an associated Runbook runtime variable.

  1. Click “Save & Close” to save this node configuration.

Variables: Set Primitive Variable: Configured (and Customized)

Previous StepNext Step