Sparround

Conditions: IF, Switch and Filter

Three nodes turn a linear workflow into a branching one, and the difference between them is not what they do but what they return:

  • IF — two outputs: matching items leave through true, the rest through false. Nothing is lost.
  • Switch — several outputs, each with its own rule. For multi-way routing.
  • Filter — one output: non-matching items are simply dropped. There is no path for them.

The selection rule is simple: use IF when you need to do something with the non-matching items, Filter when you just need to discard them, and Switch when there are more than a couple of routes.

NodeOutputsNon-matching itemsWhen
IF2 (true / false)Continue down the false branchBoth cases need a reaction
SwitchOne per rule (+ a fallback)Go to the fallback outputRouting by category
Filter1Dropped — no traceCleaning junk data out

Conditions work per item. If 50 items reach the node, IF evaluates each one separately: 30 may leave through true and 20 through false. This is not "does the whole dataset match" logic.

Type mismatch is the most frequent mistake. "5" from an API is a string, while 5 is a number. When a condition does not behave as expected, look at the value's type in the node output first: quotes mean it is a string. You may need to convert before comparing.

Mind empty values. undefined, null and an empty string are not the same thing. "The field exists" and "the field is not empty" are different conditions, and real API data contains both.

In a branching workflow every path needs an ending. Leaving an IF node's false output empty is usually a mistake: items vanish silently and nobody notices. At minimum add a No Operation node or log them, so you can answer "where did the data go?" later.

📚 Sources and documentation