Null vs. undefined values in workflows

The difference between undefined and null values is minimal, and they are often used interchangeably to represent a non-value. As a result, you may encounter unexpected behavior when designing workflows or debugging errors related to how these two values are used with various task types. This page walks through how each value behaves with specific tasks and provides a reference matrix summarizing behavior across Platform versions.

Null vs. undefined data types

Within Itential Platform, there are scenarios where null and undefined behave differently than expected when used with various task types. The examples below demonstrate these differences, followed by a task matrix that summarizes behavior across Platform versions.

Merge task example

The workflow in the example below includes a newVariable task named test and an eval (eval) task to control the job execution path. In this case, the path passes through a success transition.

Example workflow used to demonstrate null and undefined behavior

The following examples use this workflow to demonstrate how the merge task returns an object across three distinct scenarios: an undefined task input, an undefined key in a task with multiple outputs (JST task), and an undefined job variable.

The task type determines which key values are returned in the output. If a key value does not appear, the input used in the outgoing task will be null or undefined, depending on the release version you are using.

Undefined task input

The example below shows a newVariable task input named fluke2 with its assigned value.

Merge task using the fluke2 variable as input
newVariable task with the fluke2 value assigned

The merge task dialog shows the task using data from the newVariable.fluke2 job variable in key yo2.

Merge task dialog showing yo2 mapped to the fluke2 variable

After a successful workflow run, the incoming key/values to merge are visible in the Incoming tab.

Incoming tab showing key/value data passed to the merge task

The merged object in the task output shows a null value for the yo2 key.

Outgoing tab showing null for the yo2 key in the merged object

Undefined key in task with multiple outputs (JST task)

Using the same workflow, this example shows a JST task input named george2.

Merge task using the george2 JST task as input
Schema settings for the george2 JST task

The incoming schema named yo is assigned the value hello.

JST task showing yo assigned the value hello

The merge task uses data from the george2 transformation task in key yo2.

Merge task dialog showing yo2 mapped to the george2 transformation output
Incoming tab showing data_to_merge passed to the merge task

The merged object output varies by Platform version.

Platform 2021.2 and 2022.1

The merged object shows a null value for the yo2 key; however, it is stored as undefined.

Merged object output for 2021.2 and 2022.1 showing null for yo2

Platform 2023.1 and 2023.2

The merged object shows no value for the yo2 key.

Merged object output for 2023.1 and 2023.2 showing no value for yo2

Undefined job variable

This example uses a newVariable task input named fluke with the assigned value somethingfluke.

Merge task workflow using the fluke job variable
newVariable task with somethingfluke assigned to the fluke variable

The merge task uses job task data from the fluke variable in key yo2.

Merge task dialog showing yo2 mapped to the fluke job variable
Incoming tab showing data_to_merge with the fluke variable

The merged object output varies by Platform version.

Platform 2021.2 and 2022.1

The merged object shows a null value for the yo2 key; however, it is stored as undefined.

Merged object output for 2021.2 and 2022.1 showing null for yo2

Platform 2023.1 and 2023.2

The merged object shows no value for the yo2 key.

Merged object output for 2023.1 and 2023.2 showing no value for yo2

Task matrix (null vs. undefined)

The matrix below outlines the expected result for each task type across Platform versions. In the first column, three undefined scenarios are listed. Each outgoing task type is named in the header row.

To use the matrix: choose the undefined scenario from the first column and the outgoing task type from the header row. The entry where the two meet shows how the input resolves for that task.

2023.2.0+

ScenarioMergeEvalTransformationChild jobWFE automatedNon-WFE automated
Undefined task inputnullnullnullnullnullnull
Undefined key in task with multiple outputs (JST)nullnullnullnullnullnull
Undefined job variableundefinedundefinedundefinedundefinedundefinednull

2023.1.4 – 2023.2

ScenarioMergeEvalTransformationChild jobWFE automatedNon-WFE automated
Undefined task inputnullnullnullnullnullnull
Undefined key in task with multiple outputs (JST)undefinednullnullnullnullnull
Undefined job variableundefinedundefinedundefinednullundefinednull

2023.1.0 – 2023.1.3

ScenarioMergeEvalTransformationChild jobWFE automatedNon-WFE automated
Undefined task inputnullnullnullnullnullnull
Undefined key in task with multiple outputs (JST)nullnullnullnullnullnull
Undefined job variablenullundefinedundefinednullundefinednull

2022.1

ScenarioMergeEvalTransformationChild jobWFE automatedNon-WFE automated
Undefined task inputnullnullnullnullnullnull
Undefined key in task with multiple outputs (JST)undefinednullnullnullnullnull
Undefined job variableundefinedundefinedundefinedundefinedundefinednull

2021.2

ScenarioMergeEvalTransformationChild jobWFE automatedNon-WFE automated
Undefined task inputnullnullnullnullnullnull
Undefined key in task with multiple outputs (JST)nullnullnullnullnullnull
Undefined job variablenullundefinedundefinednullundefinednull