Control / flow · All operations
Branch on a condition
A variant of Branch or loop
Send the data or the run down one of several paths according to a condition, and merge the paths back afterwards.
Status
- In arcform
Not built yet
arcform does not do this yet; it would live in how a Protocol runs. Its place on the roadmap
What other tools call it
Meridian's classification; an independent blind rating agreed on 95.7% of 324 rows (variant, version 3).
Alteryx Designer (3)
Conditionread 2026-09-27Test entered values in an app or macro and branch on true or false
Detourread 2026-09-27Bypass a section of a workflow by a switch, for apps and macros
Detour Endread 2026-09-27Rejoin the two paths of an upstream Detour into one stream
Apache Hop (1)
Simple evaluationread 2026-09-27Compare a variable or result field with a value to branch the workflow
Apache NiFi (4)
Funnelread 2026-09-27Combine the data from several connections into a single connection
RouteHL7read 2026-09-27Route HL7 messages by user-defined HL7 queries, one relationship per query
RouteOnAttributeread 2026-09-27Route FlowFiles by Expression Language conditions over their attributes
RouteOnContentread 2026-09-27Route a copy of the FlowFile to each relationship whose regular expression matches the content
Azure Data Factory (2)
If Condition Activityread 2026-09-27Run one set of activities when a condition is true and another when it is false
Switch activityread 2026-09-27Run the set of activities of the case that matches an evaluated expression
Duckle (1)
Switch / Conditional Splitread 2026-09-25route rows to case outputs by condition, first match wins, plus a default
KNIME Analytics Platform (5)
CASE Switch Endread 2026-09-27Merge one or more active branches back into one
CASE Switch Startread 2026-09-27Route the input to one selectable output branch
End IFread 2026-09-27Take whichever branch is active, or stack both tables when both carry data
IF Switchread 2026-09-27Send data to the top, bottom or both output branches by configuration
Java IF (Table)read 2026-09-27Choose the output branch from a user-written Java expression returning 0 or 1
RapidMiner Studio (3)
Branchread 2026-09-27If-then-else: run one of two subprocesses depending on a condition
Join Pathsread 2026-09-27Pass on the first non-null input, merging alternative branches
Select Subprocessread 2026-09-27Switch: run the one subprocess selected by a parameter
SQLMesh (1)
@IFread 2026-09-27Emit one SQL fragment or another according to a condition evaluated at render time
Background
A conditional statement directs a program's control flow based on the value of a condition, a Boolean expression.[1] In Azure Data Factory, the If Condition activity runs one set of activities when its condition evaluates to true and another set when it evaluates to false.[2] In KNIME, the End IF node takes the data from either its top or its bottom input port, or concatenates the two tables if both branches contain data.[3]
When to use it
Branch when the paths do different work, such as a full reload on one path and a load of changes on the other, not when they differ only in a value a single expression could compute. (Meridian's view) In an else-if chain, only the statements following the first condition that is true are executed, and the others are skipped.[1] Order a chain of conditions from the most specific to the most general. (Meridian's view) A switch statement usually provides a default action for when no case matches.[1] In Azure Data Factory's Switch activity, the default activities are used when no case matches.[4] Give every branch a default path, so that a value nobody expected still goes somewhere you can see. (Meridian's view)
In Apache NiFi, a FlowFile represents a single piece of data, and a processor routes each FlowFile it has processed to one of its named relationships.[5] Apache NiFi's RouteOnAttribute processor routes FlowFiles by conditions written in NiFi's Expression Language over their attributes.[6] FlowFiles that match none of RouteOnAttribute's conditions are routed to its unmatched relationship.[6] Decide whether the problem needs one choice for the whole run or a separate choice for each row, because the two call for different kinds of step. (Meridian's view)
The method
In an if-then-else statement, control passes to the consequent when the condition is true and to the alternative when it is false, and the else part can be omitted.[1] A switch statement supports multiway branching, often comparing the value of an expression with constant values and transferring control to the code of the first match.[1] An Azure Data Factory Switch activity must have at least one case, and it allows at most 25.[4]
In RapidMiner, the Branch operator has two subprocesses, Then and Else, and runs the Then subprocess if its condition is satisfied and the Else subprocess otherwise.[7] KNIME's IF Switch node passes its data to the top output port, the bottom one or both, depending on its configuration.[8] KNIME's CASE Switch End node merges the branches of a CASE Switch Start node into one output port, and typically only one branch is active.[9] When two or more inputs of a KNIME CASE Switch End node are active, the node can concatenate the tables, fail, or output the first active input, as configured.[9]
In SQLMesh, the @IF macro changes a component of a SQL query based on the result of a logical condition, and its value for a false condition is optional.[10]
Compared with the alternatives
A conditional expression evaluates to a value without the side effect of changing control flow.[1] A branch step is the statement kind: it chooses which steps run, where an expression inside a query chooses a value and the same steps run either way. (Meridian's view)
Sources
- [1]Conditional (computer programming) - Wikipediasecondary source
- [2]If Condition activity - Azure Data Factory & Azure Synapse | Microsoft Learndocumentation
- [3]End IFdocumentation
- [4]Switch activity in Azure Data Factory - Azure Data Factory | Microsoft Learndocumentation
- [5]Apache NiFi User Guidedocumentation
- [6]RouteOnAttribute - Apache NiFidocumentation
- [7]Branch - Rapidminer Documentationdocumentation
- [8]IF Switchdocumentation
- [9]CASE Switch Enddocumentation
- [10]sqlmesh/docs/concepts/macros/sqlmesh_macros.md at 23b237cea7218cc8f338b89c14f0957394a0003b · SQLMesh/sqlmesh · GitHubdocumentation