Skip to content

Condition Operators

{
"condition": {
"operator": "eq",
"left": { "contextPath": "status" },
"right": "ready"
}
}

Works with strings, numbers, booleans.

{
"condition": {
"operator": "neq",
"left": { "contextPath": "error_count" },
"right": 0
}
}
{
"condition": {
"operator": "gt",
"left": { "contextPath": "score" },
"right": 80
}
}
{
"condition": {
"operator": "gte",
"left": { "contextPath": "items_count" },
"right": 1
}
}
{
"condition": {
"operator": "lt",
"left": { "contextPath": "retry_count" },
"right": 3
}
}
{
"condition": {
"operator": "lte",
"left": { "contextPath": "error_rate" },
"right": 0.05
}
}
{
"condition": {
"operator": "contains",
"left": { "contextPath": "message" },
"right": "error"
}
}

Also works with arrays:

{
"condition": {
"operator": "contains",
"left": { "contextPath": "tags" },
"right": "urgent"
}
}
{
"condition": {
"operator": "exists",
"operand": { "contextPath": "optional_field" }
}
}

Returns true if variable exists and is not null/undefined.

{
"condition": {
"operator": "isEmpty",
"operand": { "contextPath": "items" }
}
}

Returns true for:

  • Empty string ""
  • Empty array []
  • Null/undefined

All conditions must be true:

{
"condition": {
"operator": "and",
"conditions": [
{
"operator": "eq",
"left": { "contextPath": "status" },
"right": "complete"
},
{
"operator": "gt",
"left": { "contextPath": "score" },
"right": 80
}
]
}
}

At least one condition must be true:

{
"condition": {
"operator": "or",
"conditions": [
{
"operator": "eq",
"left": { "contextPath": "priority" },
"right": "high"
},
{
"operator": "eq",
"left": { "contextPath": "priority" },
"right": "critical"
}
]
}
}

Negates a condition:

{
"condition": {
"operator": "not",
"condition": {
"operator": "eq",
"left": { "contextPath": "status" },
"right": "blocked"
}
}
}
{ "contextPath": "variable_name" }
{ "contextPath": "user.profile.name" }
{ "contextPath": "items[0]" }
{ "contextPath": "results[0].score" }

Right-hand values can be literals:

{
"right": "string value"
}
{
"right": 42
}
{
"right": true
}
{
"right": null
}
{
"condition": {
"operator": "eq",
"left": { "contextPath": "has_tests" },
"right": "yes"
}
}
{
"condition": {
"operator": "lt",
"left": { "contextPath": "current_iteration" },
"right": 5
}
}
{
"condition": {
"operator": "and",
"conditions": [
{
"operator": "exists",
"operand": { "contextPath": "result" }
},
{
"operator": "not",
"condition": {
"operator": "isEmpty",
"operand": { "contextPath": "result" }
}
}
]
}
}