メインコンテンツへスキップ

Switch node

The Switch node partitions results among multiple paths. For each result, it compares a selected field with your case values and sends the result to the matching case path.

Use a Switch node when one field can contain several known values and each value requires different actions. A mixed batch can activate multiple case paths because CloudFlow evaluates and routes each result separately.

A Switch node routing EC2 instances to three case paths by their Environment tag

The example flow above lists all EC2 instances and uses a Switch node to route each instance by the value of its Environment tag:

  • Instances tagged production go to the production case path, where the flow skips them.

  • Instances tagged dev or staging go to the dev OR staging case path, where the flow stops them.

  • Instances whose tag matches no case go to the Default path, labeled everything else in this flow, where the flow sends a notification asking the owner to tag the instance.

In the flow editor, each case appears as a labeled path under the Switch node, followed by the Default path when it is enabled. The nodes you add under a path run only on the results routed to that path.

Add and configure a Switch node

  1. In the flow editor, select the plus icon (+) where you want to route results.

  2. Under Operations, select Switch.

  3. Select the field whose value determines the path. You can reference a field from a previous node; see Node parameters.

  4. Add a case for each value that needs its own path.

  5. (Optional) For string cases, enable Ignore case to match uppercase and lowercase variants of the same value.

  6. (Optional) Enable Default path to route results that do not match a case.

  7. Add the nodes that should run under each case path and, if enabled, the Default path.

Matching and routing behavior

Case matching is exact and type-sensitive. Case values support strings, numbers, and booleans. CloudFlow does not convert a result to another type before matching it.

Case valueMatchesDoes not match
"1"String "1"Number 1
1Number 1String "1"
trueBoolean trueString "true"
"production"String "production"String "Production" unless Ignore case is enabled

Ignore case applies only to string matching. Number and boolean matching remains exact.

CloudFlow partitions a batch per result:

  • A result that matches a case is sent to that case path.

  • An unmatched result is sent to the Default path when Default path is enabled.

  • If Default path is not enabled, an unmatched result is dropped and the Switch node still completes successfully.

  • Only paths that receive results are activated. Results in the same batch can match different cases, so more than one case path can run during one flow execution.

Compare routing nodes

  • Branch: Evaluates conditions and partitions each result between True and False paths. Use Switch instead when one field must be routed among several exact values.

  • Filter: Evaluates conditions and keeps matching results in one output while dropping the rest. Use Switch when different matching values require different downstream actions.

  • Parallel paths: Sends the complete input to every path. Use Switch when each result should go only to its matching case or the Default path instead of being copied to all paths.