Skip to main content

Condition Node

Evaluates conditions in order and routes to the first matching output.

Config shape (code-grounded)

  • config.conditions: array of { condition, output }
  • config.default_output: optional string (defaults to default)
  • Use plain JavaScript expressions referencing upstream data via $json

Example

{
"id": "n_cond",
"type": "condition_node",
"config": {
"conditions": [
{ "condition": "$json['http_trigger'].request.method === 'POST'", "output": "is_write" },
{ "condition": "$json['proxy_1'].response.status_code >= 500", "output": "upstream_error" }
],
"default_output": "fallback"
}
}

Output behavior

  • Returns matched_output with the chosen output handle.
  • If no condition matches, returns matched_output: default_output (or default).

Common pitfalls

  • Using template syntax inside condition (write plain JS, not {{ ... }}).
  • Putting broad conditions first and making later branches unreachable.
  • Forgetting to wire an edge for the default handle.