Skip to main content

Orchestrate Next Gen

Understand Dynamic Paths

Dynamic paths retrieve values from a playbook node or event data. A dynamic path expression is of the form ${valueof(<node_number>.result.<instance>.<parameter>)}, where <node_number> indicates the node from where the data is retrieved, and <parameter> 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 a playbook node:

${valueof(2.result.fusion_instance.confidence_score)} where:

  • valueof indicates communication between different nodes of a playbook. It is used to retrieve a certain value from a node execution output.

  • 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 of the confidence_score parameter.

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 

Name 

Description 

$ 

Dollar Symbol

A dynamic path begins with this indicator.

Suppose 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: 

${valueof(2.result.fusion_instance.confidence_score)} retrieve the value of confidence_score key from node number 2

{} 

Curly Brackets

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

Example: 

${playbook_metadata(last_run)} retrieves the last run details of a playbook.

[] 

Square Brackets

Square brackets are used to denote an array of objects.

Example: 

${default(valueof(1.result.fusion-instance.id), list([101,102,103]))} 

In the above example, the default values in the array list will be used if the provided dynamic path fails to execute.

* 

Asterisk

You can use * (asterisk) notation in a dynamic path to retrieve all Package IDs from values from an object list.

${valueof(2.result.fusion_instance.data.packages_list[*])} 

Keywords

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

Keywords 

Description 

valueof 

Indicates communication between different nodes of a playbook. It is used to retrieve a certain value from a node execution output.

Example:

${valueof(2.result.fusion_instance.confidence_score)} retrieve the value of confidence_score key from node number 2

You can also retrieve values from memory nodes.

  • ${valueof(country_code)} retrieves the value of variable country_code = IN from a memory node used in the playbook.

  • ${country_code} also retrieves the value of variable country_code = IN from a memory node used in the playbook.

pb_input 

Denotes the input data of a playbook.

When executing a playbook, valid input data is required to process the execution.

Example: 

In ${pb_input(incident)}, incident is a key in the triggered event data. This retrieves the value associated with the incident key and passes it as input to the playbook or a specific node.

__instance__ 

Replaces the specific app instance slug name in the dynamic path and uses the default instance of an app.

Note

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

Example:

${valueof(2.result.fusion_instance.data.result.score)} can also be re-written as ${valueof(2.result.__instance__.data.result.score)}

result 

Retrieves the execution result of a playbook node.

Example:

${2.result} retrieves the execution result of playbook node number 2.

error 

Retrieves the execution error of a playbook node.

Example:

${2.error} retrieves the execution error of playbook node number 2.

status 

Retrieves the execution status of a playbook node.

Example:

${2.status} retrieves the execution status of playbook node number 2.

playbook_metadata 

Retrieves the metadata of a playbook such as the last playbook run, last successful run, and playbook run readable ID.

Example:

  • ${playbook_metadata(last_run)} 

  • ${playbook_metadata(last_success_run)} 

  • ${playbook_metadata(playbook_run_readable_id)} 

    Note

    While retrieving metadata for the last successful run, if no successful run or match is found, the response will be <nil>.

persistent_list 

Retrieves values from a persistent list storage.

Example:

  • ${persistent_list(customer-emails)} retrieves the data from the customer-emails persistent list.

  • ${persistent_list(customer-emails,escalated.john} retrieves the email address of John from the customer-emails persistent list under the escalated data object.

datetime() 

Retrieves the data and time value from the system.

Example:

  • ${datetime(now)} retrieves the current time from the system

  • ${datetime(epoch)} retrieves the current time in Epoch format from the system

none() 

Provides a None input to a playbook node.

Example:

${none()} 

json() 

Used to define input in JSON format.

Example:

${json({"geo_location":{"lat":"20.5937 N","lon":"78.9629 E"}})} 

Note

If you provide a dynamic path in the format $JSON(${<dynamic_path>}), the result will be $JSON(the evaluated result of the dynamic path). The $JSON part is considered a string.

For example, if you define a list as sample = ['h', 'e', 'l', 'l', 'o'] and use the dynamic path $JSON(${sample[0]}) to retrieve an element from the list, the resulting output will be $JSON(h).

list() 

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("1",23,"5",list(int(1),"23",44), list(json({"String":"STRING", "k1":"23"}),list(1,2,3,bool(4), list(float(1.2),int(10)))))} 

Note

By default, the elements inside a list are treated as integers. Therefore, you have to pass the element inside quotes ("") or the str function to make the element a string.

default() 

Used to specify a default value as an input to a playbook node. The defined default value will be used only if the dynamic path validation fails and the playbook node is unable to fetch the defined input value using the dynamic path expression.

Example:

${default(valueof(1.result.fusion-instance.id), list([1,2,3]))} 

memory_variable() 

Retrieves all the key-value pairs from a previously executed memory node.

Example:

${memory_variable()}