NodeCrypto Help

Switch

Category: Input/Output Data ยท Node Type ID: switch

Picks one of several value sets and unpacks it into individual output ports

Overview

Selects one active bundle among multiple incoming ValueSet (Set) inputs and unpacks its elements into individual typed output ports. All connected Set inputs must share the same schema (the same number of elements and the same sequence of primitive types).

When you connect a ValueSet to a Switch input port, the Switch node automatically synchronizes its dynamic output ports to match the row count, names, and data types of the connected ValueSet. Clicking a radio button on the Switch card or changing the active input in the inspector immediately switches which upstream ValueSet feeds the downstream pipeline.

When to Use

Parameter Configuration

Switch is configured via its active-branch selector on the node card and in the property inspector:

SettingTypeDefaultDescription
Active Input (selected) select (Input port ID) in_1 (first connected input) Selects which incoming Set port is routed to the unpacked output ports at runtime. If the selected port is unconnected, the node falls back to the first connected input port.

Port I/O Specification

See Ports & Connections for general wiring rules, data type colors, and dynamic port creation.

Input Ports

AttributeSpecification
Port NatureDynamic / Variable Input Ports
Initial Default on CanvasStarts with 1 default input port (Set 1, id: in_1, type Set).
Port Count Range1 or more Set input ports.
Allowed Data TypesSet only (must be connected from a ValueSet node's Set output port, and all connected sets must have matching row types).
Adding & Managing PortsDrag a connection from another ValueSet onto the [+] auto-create handle or add/remove input ports in the inspector.
Evaluation & Ordering RuleEach input port represents one candidate ValueSet branch; only the branch matching Active Input is unpacked at runtime.

Output Ports

AttributeSpecification
Port NatureDynamic / Variable Output Ports (Schema-Synchronized)
Initial Default on Canvas0 output ports before a ValueSet is connected; automatically populated to match the connected ValueSet rows upon connection.
Port Count RangeMatches the number of rows in the connected ValueSet.
Allowed Data TypesBytes, String, Int, or Bool (mirrors the element types of the connected ValueSet).
Adding & Managing PortsOutput port count and types are automatically derived from the connected ValueSet schema; output port labels can be customized in the inspector.
Evaluation & Ordering RuleThe i-th output port receives the i-th row value from the currently active ValueSet input.

Error Cases

When any of the following conditions occurs at runtime, this node transitions to an ERROR state and downstream nodes connected to its outputs do not execute.

Error CodeDefault Engine MessageTrigger Condition
SET_SCHEMA_MISMATCH The active set is not compatible with the baseline set Raised on a Switch node when the selected active ValueSet does not have the same row count and row types as the baseline ValueSet.

Examples

Toggling Between Two Cryptographic Test Vectors

Connect two ValueSet nodes to a Switch node to swap all inputs to an encryption pipeline at once.

  1. Create two ValueSet nodes, each with rows Key (Bytes) and Plaintext (Bytes).
  2. Connect the Set output of the first ValueSet to Set 1 on the Switch node, and the second ValueSet to the [+] handle (creating Set 2).
  3. Connect the Switch node's unpacked Key and Plaintext output ports to your cipher node, and toggle between Set 1 and Set 2.