true or false. Use it to build conditional branches in your agent — route a conversation based on a classification result, check whether a score exceeds a threshold, or verify that a date falls within range.
Compare automatically detects whether the values are numbers, dates, booleans, or strings and applies the appropriate comparison logic. No manual type casting required.
Configuration
1
Left operand
The first value to compare. Accepts plain text or an expression like
{{Steps.Classifier.Value}}.2
Operator
The comparison to perform. See the full operator table below.
3
Right operand
The second value. Not required for
Is Empty and Is Not Empty operators.4
Case sensitive
Toggle for string comparisons. Off by default —
"hello" matches "Hello". Turn on when exact casing matters.Operators
- Universal
- Ordering
- String-only
- Existence
These work with all detected types — numbers, dates, booleans, and strings.
Automatic type detection
Compare inspects both values and picks the best type in this order:Type detection runs on the resolved values, not the raw expression text. If
{{Steps.Score.Value}} resolves to "85", it will be detected as a number, not a string.Output
The step returns a boolean:true if the comparison passes, false if it does not.
Use the output to drive conditional routing downstream:
Use case: route by customer tier
An e-commerce agent receives an order and needs to apply different handling based on the customer’s annual spend. Agent flow:
When the customer’s annual spend is 10,000 or more, the Compare step returns
true and the agent routes to the VIP handler. Otherwise, it routes to the standard handler.
