Skip to main content

Cyware Orchestrate

Understand Dynamic Paths

You can use dynamic paths to retrieve values from a Playbook node or event data. A dynamic path expression is of the form ${_node_number::parameters}, where <_node_number> indicates the node from where the data is fetched, and <parameters> indicates the key in a key-value pair.

The syntax of a dynamic path expression varies for different types of nodes in a Playbook. For example, the following dynamic path retrieves the confidence_ score from the output of Playbook node:

${_2::result::fusion_instance::confidence_score}where:

  • _2: indicates that the data is retrieved from the output of Playbook node #2

  • result: indicates that we are fetching the input based on the successful execution result of node #2

  • fusion_instance: indicates the name of the app instance used in the app-action node

  • confidence_score: indicates the key field confidence_score

Note

A value provided in the input or output field of a Playbook node without a dynamic path initiator ($) is considered a string.

Notations

The following table describes the notations that can be used in a dynamic path.

Notation

Description

$ (Dollar Symbol)

A dynamic path begins with this indicator.

If the $ symbol is not used at the beginning of a dynamic path expression, then the input value is treated as a string and can result in an unexpected error during a Playbook execution.

Example:{_2::result::fusion_instance::data::result::score}results in a string input as the dynamic path indicator is missing.

{} (Curly Brackets)

Curly brackets follow the $ (dollar symbol) and is used to start and end a dynamic path.

Example:${_2::result::fusion_instance::data::result::score}

[] (Square Brackets)

Square brackets contain the input data when LIST and JSON keywords are used in a dynamic path.

Example:

  • $JSON[{"key": "value"}]

  • $LIST[1,2,4]

:: (Double Colon)

A double colon separates the nested keys in a dynamic path expression. It also determines the depth of the key-value pair to be retrieved using a dynamic path.

Example:

top_level_key::nested_key::inside_key

_ (Underscore)

Underscore is used as the prefix of a Playbook node number.

Example: _1 denotes Node #1 of a Playbook.

* (Asterisk)

Asterisk is used to iterate over all the elements of a list and return a list of required values.

You can use the following notations to retrieve a specific value from a list:

• Use 0 to retrieve the first element from a list

• Use 1 to retrieve the second element from a list, and so on

Example:

You can use * (asterisk) notation in a dynamic path to retrieve all Package IDs from a Packages List:

${_2::result::fusion_instance::data::result::packages_list::*}

You can use 0 (zero) notation in a dynamic path to retrieve a Package ID from index 0 of Packages List:

${_2::result::fusion_instance::data::result::packages_list::1}

Keywords

The following table describes the keywords that you can use in a dynamic path.

Keywords

Description

__instance__

_instance_ replaces the specific app instance slug name in the dynamic path and uses the available app instance.

Note

__instance__ can be used in nodes configured with only one instance.

Example: ${_2::result::fusion_instance::data::result::score} can also be re-written as ${_2::result::__instance__::data::result::score}

result

result keyword retrieves the execution result of a Playbook node.

Example: ${_2::result} retrieves the execution result of Playbook node number 2.

io

io keyword retrieves the user input provided in a Playbook input node.

Example: ${_2::io::api_key} retrieves the value of API key from node 2 (input node) of a Playbook.

const

const keyword retrieves the data from a Playbook Memory node.

Example: ${const::country_code} retrieves the value of variable country_code = IN from a memory node.

$NONE

$NONE keyword provides a None input to a Playbook node.

Example: $NONE

$JSON

$JSON keyword can be used to define input in a JSON format.

Example: $JSON[{"geo_location":{"lat":"20.5937 N","lon":"78.9629 E"}}]

$LIST

$LIST can be used to specify a list of values as input to a Playbook node.

If you need an app-action to iterate over the provided list of values to execute the action for each item, then you can specify a list of values as an input.

Example: $LIST[192.168.2.1, 192.168.2.2, 192.168.2.3]