Skip to main content

Condition Action

The condition action evaluates filter conditions against request data and chain variables to control whether the automation chain continues or stops.

Configuration

{
"type": "condition",
"name": "Only process paid orders",
"config": {
"conditions": [
{"body.status": {"$eq": "paid"}}
],
"on_match": "continue",
"on_no_match": "stop"
}
}

Fields

FieldTypeRequiredDescription
conditionsarrayYesFilter conditions to evaluate
on_matchstringNoWhat to do when conditions match: "continue" (default) or "stop"
on_no_matchstringNoWhat to do when conditions don't match: "continue" or "stop" (default)

Filter conditions

Conditions use the same filter engine as Mock Response Rules. See that page for the full list of operators ($eq, $neq, $gt, $contains, $in, $regex, $and, $or, $not, etc.).

Conditions are evaluated against a merged context that includes both the incoming request data and any chain variables set by previous actions.

Available fields

FieldExampleDescription
methodPOSTHTTP method
path/api/webhookRequest path
headers.<name>headers.content-typeRequest header
query.<name>query.tokenQuery parameter
body.<path>body.order.statusJSON body field (dot notation)

Examples

Stop chain for non-POST requests

{
"conditions": [{"method": {"$eq": "POST"}}],
"on_match": "continue",
"on_no_match": "stop"
}

Only process specific event types

{
"conditions": [
{"body.type": {"$in": ["order.created", "order.updated", "order.completed"]}}
],
"on_match": "continue",
"on_no_match": "stop"
}

Complex condition with logical operators

{
"conditions": [
{
"$and": [
{"method": {"$eq": "POST"}},
{"body.amount": {"$gte": 100}},
{"headers.x-source": {"$exists": true}}
]
}
],
"on_match": "continue",
"on_no_match": "stop"
}

Stop chain on match (inverse logic)

Use on_match: "stop" to halt the chain when a condition is true — useful for filtering out unwanted events:

{
"conditions": [{"body.type": {"$eq": "ping"}}],
"on_match": "stop",
"on_no_match": "continue"
}