Conditions

Conditions control whether an individual Actions executes at runtime. An action's conditions array is evaluated before the action runs; if the conditions are not satisfied, the action is skipped.

A conditions array MAY contain any mix of Condition objects and Operator objects. Operators are used to compose multiple conditions with boolean logic.

Condition Properties

Property
Type
Required
Default
Constraints
Description

channelTypes

string | array of string

No

Restricts to one or more channel type identifiers (e.g. "rcs", "dsc").

channelIds

integer | string | array

No

Restricts to specific channel IDs.

tags

string | array of string

No

Requires the conversation to have these tag(s) assigned.

deviceTypes

string | array of string

No

If available

Restricts to device type(s).

devicePlatforms

string | array of string

No

If available

Restricts to device platform(s).

comparisons

array of Comparison

No

Each item: array of exactly 3 items

Attribute value comparisons.

unit

string

No

"km", "m", "mi", "ft"

Unit for distance comparisons.

precision

number

No

Decimal precision for numeric comparisons.

Comparison Operators

Each entry in comparisons is a three-element array: [attributeName, operator, value].

Operator
Applies to
Semantics

==

string, number, boolean

Attribute value equals comparison value (strict equality).

!=

string, number, boolean

Attribute value does not equal comparison value.

<

number

Attribute value is less than comparison value.

>

number

Attribute value is greater than comparison value.

<=

number

Attribute value is less than or equal to comparison value.

>=

number

Attribute value is greater than or equal to comparison value.

contains

string

Attribute value contains comparison value as a substring.

startsWith

string

Attribute value starts with comparison value.

endsWith

string

Attribute value ends with comparison value.

The third element (comparison value) MUST be a string, number, or boolean.

Operator

An Operator object is inserted into the conditions array to combine adjacent Condition objects with boolean logic.

Property
Type
Required
Constraints
Description

operator

string

Yes

"AND", "OR", "NOT"

Logical operator to apply.

AND / OR / NOT Semantics

  • AND — All conditions on both sides MUST be satisfied.

  • OR — At least one condition on either side MUST be satisfied.

  • NOT — The following condition MUST NOT be satisfied.

circle-info

When no Operator is specified between multiple Condition objects in a conditions array, the platform's default combining behavior is AND. For explicit control, always include Operator objects.

Composition Rules

1

Condition and Operator evaluation order

Condition objects and Operator objects are evaluated in array order.

2

Operator scope

An Operator applies to the Conditions immediately surrounding it.

3

NOT scope

NOT applies only to the Condition immediately following it.

4

Nesting

Nesting is achieved by ordering Conditions and Operators carefully; the schema does not support a parenthetical grouping syntax.

Examples

Single Condition — Channel Type

Execute this action only on RCS channels:

Single Condition — Attribute Comparison

Execute this action only when the attribute accountTier equals "premium":

Multiple Comparisons Within One Condition

Multiple entries in the comparisons array within a single Condition are combined with AND:

AND Operator — Two Conditions

Both conditions must be satisfied:

OR Operator — Two Conditions

Either condition satisfies the check:

NOT Operator — Negated Condition

Execute this action only when the user does NOT have the opted-out tag:

Complex Composition — Tags AND (Channel OR Attribute)

Channel ID Restriction

Restrict an action to specific channel IDs:

Distance-Based Condition

Check proximity using coordinates with unit specification:

Last updated

Was this helpful?