Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Flow Control

Flow controls allow you to build out decision logic within Decision steps and Action steps. They can also be used anywhere else a parameter is configured, including trigger conditions. These parameters calculate values; an If parameter does not add a branch to the workflow by itself.

The JSON examples show complete parameter objects from the copied-workflow format. The order of children in params matters.

If

JSON type: comparison. Expression: one of the comparison keys listed below. Children: the left value, followed by the right value when the comparison needs one. Result: true or false for a valid comparison.

Creates a boolean statement with a left and right comparison. For example, compare a member's status to Active, or compare the number of check-ins to 10. The available comparison choices depend on the left parameter's type.

Both sides are evaluated before comparing them. Comparisons do not automatically trim text, ignore case, or parse numbers from text. Use Text Manipulation or Parse Number first when needed. An invalid type or an error in either child still causes an error. Some comparisons accept null, as described below. Use And to check for null before a comparison that requires a value.

Comparison options

These are all the comparison choices. The JSON keys are case-sensitive.

String comparisons

Text comparisons are case-sensitive. L means the first child and R means the second child in this table. Text on the right must be a string, even when the left is a record's primary ID; a Text parameter can convert an ID to a string when necessary.

Choice

JSON expression

Meaning

(String) is equal to

STRING_EQUALS

L and R are exactly the same text.

(String) is not equal to

STRING_NOT_EQUALS

L and R are different.

(String) is contained within

STRING_IS_IN

L is a substring of text R, or an exact item in a string array R.

(String) begins with

STRING_STARTSWITH

L starts with R.

(String) ends with

STRING_ENDSWITH

L ends with R.

(String) is not contained within

STRING_NOT_IS_IN

L is not a substring or array item in R.

(String) includes

STRING_INCLUDES

Text L contains substring R. This reverses the operands of “is contained within.”

(String) does not include

STRING_NOT_INCLUDES

Text L does not contain substring R.

(String) does not begin with

STRING_NOT_STARTSWITH

L does not start with R.

(String) does not end with

STRING_NOT_ENDSWITH

L does not end with R.

Equality and inequality accept null: two null values are equal, and null is different from any string, including "". With null on the left, “begins with,” “ends with,” and “includes” return false; their negative comparisons return true. Prefix and suffix comparisons still require non-null text on the right.

For “is contained within,” the right side must be non-null; a null left side is not contained in text, but can match a null item in an array. For “includes,” a null right side is not included in text. The corresponding negative comparisons reverse those results. Empty text is a substring, prefix, and suffix of any string.

This example returns true because Active begins with Act:

This example also returns true. When the right side is an array, “is contained within” matches a whole item, not a substring:

Array of Strings comparisons

The left side can be an array of strings, an empty array, or null. The right side is one string or null. These comparisons look for an exact item, not part of an item's text. A null right side matches a null item in the array. With null on the left, “includes” returns false and “does not include” returns true.

Choice

JSON expression

Meaning

(Array of Strings) includes

ARRAY_STRING_INCLUDES

The left array contains the right value.

(Array of Strings) does not include

ARRAY_STRING_NOT_INCLUDES

The left array does not contain the right value.

This example returns true:

Number comparisons

Use numbers on both sides. A numeric string such as "10" needs Parse Number first. Equality and inequality also accept null; two nulls are equal and null is not equal to a number. The four ordering comparisons return false when the left side is null. The right side must still be a non-null number.

Choice

JSON expression

Meaning

(Number) is greater than

NUMBERLIKE_GREATER_THAN

Left is greater than right.

(Number) is less than

NUMBERLIKE_LESS_THAN

Left is less than right.

(Number) is greater than or equal to

NUMBERLIKE_GREATER_THAN_OR_EQ

Left is greater than or equal to right.

(Number) is less than or equal to

NUMBERLIKE_LESS_THAN_OR_EQ

Left is less than or equal to right.

(Number) equals

NUMBERLIKE_EQUALS

Left and right are equal.

(Number) not equal to

NUMBERLIKE_NOT_EQUALS

Left and right are different.

This example returns true:

Date comparisons

Compare calendar dates with no time portion. After and before are strict: equal dates satisfy neither. Equality and inequality accept null. After and before return false when the left side is null, but require a non-null date on the right.

Choice

JSON expression

Meaning

(Date) is after

DATE_AFTER

Left date is later than right date.

(Date) is before

DATE_BEFORE

Left date is earlier than right date.

(Date) is equal to

DATE_EQUALS

Left and right are the same date.

(Date) is not equal to

DATE_NOT_EQUALS

Left and right are different dates.

For older workflows, the runtime also accepts parseable date text or a datetime in a Date comparison. It takes the datetime's calendar date without converting its timezone. Invalid date text causes an error. Use Date or explicit date conversion in new parameters so the intended type is clear.

This example returns true:

Datetime comparisons

Compare timestamps. Two timestamps with different timezone offsets can be equal if they represent the same instant. After and before are strict. Equality and inequality accept null. After and before return false when the left side is null, but require a non-null datetime on the right. A Date without a time portion is not a Datetime for these comparisons.

Choice

JSON expression

Meaning

(Datetime) is after

DATETIMELIKE_AFTER

Left timestamp is later than right timestamp.

(Datetime) is before

DATETIMELIKE_BEFORE

Left timestamp is earlier than right timestamp.

(Datetime) is equals

DATETIMELIKE_EQUALS

Left and right represent the same instant.

(Datetime) is not equals

DATETIMELIKE_NOT_EQUALS

Left and right represent different instants.

Older workflows may supply parseable timestamp text. Text without a timezone is interpreted as UTC. An existing datetime without a timezone is handled differently: when only one of the two datetime values has a timezone, the other is compared using that same timezone. If neither has one, their clock values are compared directly. Use explicit offsets in new parameters to avoid relying on these fallbacks. Invalid timestamp text causes an error.

This example returns true; both timestamps refer to the same instant:

Time comparisons

Compare time-of-day values with no date. Use Time or Construct Time rather than text. After and before are strict and return false when the left side is null. With a time on the left, the right side must be a non-null time. Equality and inequality can compare a time to null. When using timezones, both operands should either include an offset or both omit one; ordering a time with an offset against one without an offset causes an error. These comparisons do not treat the day as a loop: 01:00 is before 23:00 on the same clock, not two hours after it.

Choice

JSON expression

Meaning

(Time) after

TIME_AFTER

Left time is later than right time.

(Time) before

TIME_BEFORE

Left time is earlier than right time.

(Time) equals

TIME_EQUALS

Left and right times are equal.

(Time) not equals

TIME_NOT_EQUALS

Left and right times are different.

This example returns true:

Boolean comparisons

Use true or false values, not the text "true" or "false". Equality and inequality also allow null on either side. The unary choices use only the left child; do not include a right child in their params array.

Choice

JSON expression

Meaning

(Boolean) is equal to

BOOLEAN_IS

Both sides are the same boolean value, or both are null.

(Boolean) is not equal to

BOOLEAN_IS_NOT

The sides differ, including a boolean compared with null.

(Boolean) is True (null raises error)

BOOLEAN_IS_TRUE

Tests a Boolean parameter for true. An explicit Null parameter is invalid.

(Boolean) is False (null raises error)

BOOLEAN_IS_FALSE

Tests a Boolean parameter for false. An explicit Null parameter is invalid.

“Is True” and “Is False” raise an error when the left value is null, including when it comes from a Boolean field. Use the null or truthiness comparisons below when missing values should produce a true or false result instead.

This example returns true and has no right child:

Null, truthiness, and general equality

Truthiness asks whether a value counts as true in a condition. Null, false, zero, an empty string, an empty array, and an empty object are falsey. Other values are truthy. Text such as "false", "0", or a space is truthy because it is not empty. Null checks only test for null, not for an empty or zero value.

Choice

JSON expression

Children

Meaning

Not null, not blank, not zero, or True (Truthy)

VALUE_IS_TRUTHY

Left only

True when the left value is truthy.

Null, or blank, or zero, or False (Falsey)

VALUE_IS_FALSEY

Left only

True when the left value is falsey.

Is null

VALUE_IS_NULL

Left only

True only when the left value is null.

Is not null

VALUE_IS_NOT_NULL

Left only

True when the left value is anything other than null.

Equals

VALUE_EQUALS

Left, right

Compares the values for equality.

Not equals

VALUE_NOT_EQUALS

Left, right

Compares the values for inequality.

The first four choices work with any parameter type. General equality is available for strings, primary IDs, numbers, dates, datetimes, booleans, times, string arrays, empty arrays, and null on the left. The right side accepts strings, numbers, dates, datetimes, booleans, string arrays, empty arrays, or null; use TIME_EQUALS and TIME_NOT_EQUALS to compare two times. Other arrays and objects support truthiness and null checks, not general equality.

General equality does not parse or convert text: the number 10 is different from the string "10". It uses value equality, so true equals 1, false equals 0, and string arrays are equal only when their items and order match. Use the typed comparisons when you want the editor to require a particular type. An empty array is different from null.

This example returns true:

This example returns false because the number and string are different values:

And

JSON type: and. Expression: unused. Children: one or more Boolean parameters, in order. Result: true only when all children are true.

Groups together IF statements where all need to be true to pass. Children are evaluated from top to bottom. Evaluation stops at the first false result, so later children are not evaluated. This lets an earlier condition protect a later condition from an invalid value, such as checking that a date is not null before comparing it.

With no children, And causes an error. Children should return booleans; And does not parse text such as "false" into false.

This example returns false. The first comparison returns false, so the second comparison is skipped:

Or

JSON type: or. Expression: unused. Children: one or more Boolean parameters, in order. Result: true when any child is true.

Groups together IF statements where only one needs to be true to pass. Children are evaluated from top to bottom. Evaluation stops at the first true result. If every child is false, the result is false. With no children, Or causes an error. As with And, children should return booleans.

This example returns true:

Switch

JSON type: switch. Expression: unused. Children: alternating condition and result pairs, followed by one default result. Result: the value of the first matching result, or the default.

Allows you to build "if, then, default" logic where there is a condition tested and an output based on whether a condition is met. In JSON, params is ordered as [condition, result, condition, result, default]. There must be an odd number of children, with at least one child. A Switch with just one child returns that default value.

Conditions must return booleans. Switch checks them from top to bottom and stops at the first true condition. Only that condition's result is evaluated. If none match, only the default result is evaluated. Unselected results and later conditions are skipped. The result keeps the chosen child's type; it is not converted to text or a boolean. Result types must be suitable for the field using the Switch. Use Null as the default when no match should produce no value.

This example returns 10: the first condition is false, the second is true, and the default 0 is skipped.

Last updated

Was this helpful?