Last updated on Oct 28, 2026

Switch

The Switch block allows you to check a series of conditions in parallel and route the flow to the first branch whose condition is true, thus avoiding the stacking of "Condition" blocks.

This block acts as a logical switch, ideal for managing mutually exclusive cases or prioritizing checks in a specific order.

๐Ÿ“ฅ Entries

  • in (Signal): Triggers the evaluation of conditions. The checks are carried out in numerical order (1, 2, 3...).
  • paths (Integer): Defines the number of test paths to create. Dynamically changes the number of available inputs and outputs.
  • 1, 2, 3... (Boolean): Logical inputs corresponding to the conditions to be evaluated. Each input can be connected to a condition block or forced to True/False.

๐Ÿ“ค Outings

  • 1, 2, 3... (Signal): Outputs activated if the corresponding condition is the first evaluated as true.
  • default (Signal): Default output used if none of the conditions are true.

๐Ÿ’ก Example of use

Scenario: Management of rewards according to the player's score

  1. A player completes a level with a score recorded in the player_score variable.
  2. The Switch block is configured with paths = 3 to manage 3 reward levels.
  3. The inputs are connected as follows:
  • 1: Condition "player_score > 1000" (Gold reward)
  • 2: Condition "player_score > 500" (Silver reward)
  • 3: Condition "player_score > 0" (Bronze reward)
  1. If the score is 750, condition 2 is the first true: the flow takes exit 2 to award the Silver reward.
  2. The default output is connected to a โ€œTry again!โ€ message. for zero or negative scores.

โš™๏ธ Technical Details

  • Order of evaluation: The conditions are checked sequentially (1 โ†’ 2 โ†’ 3...). As soon as a condition is true, the following ones are ignored.
  • Variable management: Boolean inputs can be populated with dynamic comparisons or static values.
  • Default output: Always present, even if not used explicitly. Omitting it from the flow can cause unexpected behavior.

Documented version: v1