Short answer: Use IF for one true path and one false path. Use Switch when one value can select among three or more routes. Keep the condition close to the data it evaluates.

When does an IF node fit?

IF is the clear choice for a binary test. Examples include checking whether an email field exists, whether an order total exceeds a limit, or whether a previous node returned an error flag. The node gives you true and false outputs, so the next step is easy to inspect.

Use separate IF nodes when the tests are independent. Chain them when the second test should run only after the first condition passes. This keeps each condition short and makes failed executions easier to read.

When is Switch better?

Switch suits a field with several known values. A status such as new, paid, cancelled, and refunded can map to four named outputs. Each route can then call a different node or sub-workflow.

Use an explicit fallback output for an unknown value. Without it, a new status may leave the workflow with no useful route. Log the original value before the branch if the input comes from an external system.

How should the conditions be written?

Compare the same type on both sides. Convert a number before a numeric comparison. Trim or normalize text when the source may contain spaces or mixed case. Put expressions in the value field, not inside a long label that hides the actual test.

Test one normal value and one boundary value. For a count limit of 10, test 9, 10, and 11. For a status route, test a blank value and an unknown value as well.

What should you inspect after a branch changes?

Run the workflow with a small input set. Check the item count on every output. Confirm that each downstream node receives the fields it expects. If the workflow has nested branches, the workflow structure guide helps trace the path.

For retries and failure notices, connect the branch to the error trigger workflow guide after the routing rule is working.

References

Leave a Reply

Your email address will not be published. Required fields are marked *