Process Nodes

Switch Case

Category
Logic and Flow Control
Node Type
Conditional Branching Node

Overview

The Switch Case Node enables conditional logic within your workflow. It evaluates an input value and directs the workflow to the appropriate branch based on the defined conditions. If no condition matches, the workflow continues through the Default path, ensuring uninterrupted execution.

This node is ideal for creating workflows that require multiple decision points, such as routing data, performing different actions based on user input, or managing alternative outcomes.

Description

Route workflow execution based on values.

The Switch Case Node functions like a decision gate. It checks an incoming value—such as a number, text, or boolean—and determines which branch of the workflow should be executed next.

Matched Case

If the input matches a defined case (e.g., "1"), the workflow follows that specific path.

Default Path

If no cases match, the workflow follows the Default path to handle the fallback.

For example:

  • If input is "1" → Go to "Add Data".
  • If input is "2" → Go to "Delete Data".
  • Else → Go to "Default" (e.g., Return Error).

Input Parameters

The Switch Case node accepts the value to evaluate and the list of cases.

ParameteranyRequired
The value to be checked (e.g., from a previous node).
Example
"2"
CasesarrayRequired
A list of possible values that determine workflow branching.
Example
["1", "2", "3"]
DefaultstringRequired
The fallback route if no cases match.
Example
"default-path-id"
Parameter TypestringRequired
The type of input value: 'string', 'integer', 'boolean'.
Example
"integer"

Output Parameters

The node outputs details about the matched case and the next step.

parameteranyOptional
The value that was checked.
Example
1
parameterTypestringOptional
The type of data used in evaluation.
Example
"integer"
matchedCasestringOptional
The case name that matched the input value (or 'default').
Example
"Add Data"
nextNodestringOptional
The ID or name of the next node to be executed.
Example
"add-data-3"

Output Type

Output Type: JSON

The output provides structured data about the decision made, which is useful for debugging or logging the workflow path.

Example Usage

Example 1: Case Match

Routing based on user selection.

{  "input": {    "number": "1"  }}
{  "parameter": 1,  "parameterType": "integer",  "matchedCase": "Add Data",  "nextNode": "add-data-3"}

Explanation: Input "1" matched the "Add Data" case.

Example 2: Default Fallback

Handling an invalid option.

{  "input": {    "number": "5"  }}
{  "parameter": 5,  "parameterType": "integer",  "matchedCase": "default",  "nextNode": "return-error-node"}

Explanation: Input "5" did not match any case, so it went to Default.

How to Use in a No-Code Workflow

1

Add the Node

Drag and drop the Switch Case Node into your workflow.

2

Select Input

Connect a trigger or previous node and select the Parameter to evaluate (e.g., user_choice).

3

Define Cases

Add cases for each expected value (e.g., "1", "2", "3").

4

Connect Branches

Connect each Case Output to the appropriate next node (e.g., Case "1" → Add Data).

5

Set Default

Connect the Default Output to a fallback node (e.g., Send Error Message) to handle unmatched inputs.

6

Run Workflow

Test with different inputs to ensure correct routing.

Best Practices

  • Always include a Default branch to prevent workflow interruptions.
  • Ensure the data type of your input matches the defined case values.
  • Use clear names for your cases.

Do / Don’t

Do
  • ✔️ Use Switch Case for multiple options (3+), use If/Else for binary (True/False).
  • ✔️ Handle the Default path gracefully (e.g., return a helpful error message).
  • ✔️ Verify input types (string "1" is not equal to integer 1).
Don’t
  • ❌ Don’t leave the Default branch disconnected.
  • ❌ Don’t create duplicate cases for the same value.
  • ❌ Don’t use complex logic inside a Switch Case; keep it to simple value matching.

Common Errors

Goes to DefaultWarningOptional
Input didn't match any case. Check for type mismatch (string vs int).
Stops UnexpectedlyErrorOptional
Default branch is not connected.
Wrong Node TriggeredErrorOptional
Cases are connected to the wrong nodes. Check your connections.

Example Workflow Integration

Use Case 1: Order Status Routing

Process orders based on their current status.

  1. Trigger: Order Updated.
  2. Switch Case: Check status.
    • Case "Pending": Route to Send Reminder.
    • Case "Shipped": Route to Notify Customer.
    • Case "Delivered": Route to Ask for Review.
  3. Default: Log unknown status.

Workflow Data Flow:

{{order.status}} →  {{switchCase.parameter}}

Use Case 2: User Role Access

Redirect users based on their role.

  1. Trigger: User Login.
  2. Switch Case: Check role.
    • Case "Admin": Go to Admin Dashboard.
    • Case "Editor": Go to Content Panel.
    • Case "Viewer": Go to Home Page.
  3. Default: Go to Login Page (Access Denied).

Workflow Data Flow:

{{user.role}}    →  {{switchCase.parameter}}