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
Left operand
The first value to compare. Accepts plain text or an expression like
{{Steps.Classifier.Value}}.Operators
- Universal
- Ordering
- String-only
- Existence
These work with all detected types — numbers, dates, booleans, and strings.
| Operator | What it checks |
|---|---|
| Equals | Left is exactly equal to Right |
| Not Equals | Left differs from Right |
Automatic type detection
Compare inspects both values and picks the best type in this order:| Priority | Detected as | Example values | Notes |
|---|---|---|---|
| 1 | Boolean | true, false | Only Equals / Not Equals are valid |
| 2 | Number | 42, 3.14, -100, 1e-5 | Parsed as decimal for precision |
| 3 | Date | 2026-03-26T14:30:00Z | ISO 8601 with timezone required |
| 4 | String | Everything else | Fallback — all operators available |
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:| Field | Value |
|---|---|
| Left | {{Steps.Fetch_Customer.Output.Body.annualSpend}} |
| Operator | Greater Than or Equal |
| Right | 10000 |
| Case sensitive | — (not applicable for numbers) |
true and the agent routes to the VIP handler. Otherwise, it routes to the standard handler.
