evaluation
The evaluation task replaced the decision task deprecated in the Gen 2 workflow canvas for 2023.2. See the Breaking Change: Decision Task Replaced.
The evaluation task controls workflow execution paths based on runtime conditions. Use this task to compare values and determine which path your workflow should follow.
When the task’s conditions are met, the task outputs true and execution continues through any success transitions. Otherwise, the task outputs undefined and execution continues through any failure transitions.
This page covers setting the task condition, constructing evaluations, and using operators with different data types.
Output behavior changes in Platform 2023.1 and later
If you’re migrating workflows from Platform 2022.1 to Platform 2023.1 or later, be aware of a change in how the evaluation task displays its output when the fail path is taken.
This change affects only how the outcome appears in the job/task view and API responses, not how your workflow executes. When validating migrated workflows, check the transition path to confirm whether the success or fail path was taken, rather than relying on the return value field.
Type inference and coercion
By default, the evaluation task automatically performs type inference and coercion:
- First operand — If the first operand can be parsed from a string into another type, the task converts it automatically. For example, the string
"500"is converted to the number500. - Second operand — The task attempts to convert the second operand to match the first operand’s type. If conversion isn’t possible, the evaluation rule fails.
Enable strict types
You can disable type coercion by enabling Strict Types mode. When enabled, the task compares operands exactly as provided without any type conversion.
The following example shows how the != operator behaves differently based on the strict types setting:
Enable strict types when you need predictable string comparisons without automatic type conversion.
Construct an evaluation
Evaluations are expressions consisting of two operands (A and B) and a comparison operator. When the task runs, it compares operand A to operand B and yields true or false.
By default, evaluations display vertically. To display them horizontally, click Expand at the top-right of the task configuration window.
Evaluation groups
All evaluations belong to an evaluation group. Each group resolves to true or false by logically combining its evaluation results. Each group has its own conditional statement that works the same way as the task condition.
Create an evaluation
Use queries with arrays and objects
If operand A is an array or object, you can use a query to determine its value:
- Select the Enable Query checkbox.
- Enter your query using the same syntax as the query task.
At runtime, the query executes and its results become the value of operand A.
Operator reference
Operator behavior depends on the data types of the operands.