Condition
Adds different journey logic based on a yes/no condition.
Description
This step selects a journey branch based on whether a condition, defined as an expression, evaluates to true
or false
. For example, you can alter the flow based on conditions such as whether a user already exists, a user's age, a device is registered, or a transaction exceeds a certain amount.
The condition is specified as a single AuthScript expression, which is evaluated at runtime. The journey will proceed to the Yes branch if the condition evaluates to true
, and to the No branch if it evaluates to false
. If the evaluation fails or the expression results in an error, an Otherwise branch is selected (if configured).
To simplify creating the condition expression:
- Click the Expression Editor button to use AI assistance in crafting your expression.
- Once generated, you can copy the code and test it in the Expression Fiddle ( Admin Portal > Orchestration > Expression Fiddle ) to ensure it behaves as expected.
For simpler checks, such as verifying the existence of a value, you can omit additional operands and rely on the expression itself to return a boolean result.
Configuration
Field | Description |
---|---|
Condition | An expression that evaluates the condition for the step. The expression must return a boolean value (true or false ) to determine whether the condition is met. For example, use expressions like @policy.user().age > 18 or @strings.contains(@policy.request().email, "example.com") or let result = number >= 1000 return result to define custom logic. |
Example: Evaluating a transaction amount to enforce additional security
Suppose a condition is used to determine whether to proceed to a step-Up authentication branch or allow the user to complete a transaction directly. The decision is based on whether the transaction amount is equal to or exceeds $1000: @policy.request().transactionAmount >= 1000
.
-
If the expression evaluates to
true
(the transaction amount is $1000 or higher), the journey proceeds to the step-up authentication branch to enforce additional verification. -
If the expression evaluates to
false
(the transaction amount is less than $1000), the journey proceeds to the branch that allows the transaction without requiring additional steps.
This allows for dynamic risk-based decision-making in user journeys.