# Switch Case

**Switch Case** node lets you check for a condition based on a **variable** which might be the result of some other conditions as well. Depending on the value of the **variable**, the Flow Execution will be sent to the branch matching that particular value.

### Adding Switch Case node at the end

As you see in the below image, a **Switch Case** node comes with two default child branches - **Default Case** and **Add Case** branch. You can keep adding cases in the switch as well as use the Default Branch for **Default** case.

<figure><img src="/files/jZbYJ6CajGFayAkGhQ5z" alt="" width="375"><figcaption></figcaption></figure>

### Adding Switch Case node between 2 nodes

If you try adding the **Switch Case** node between 2 existing nodes, you will see a popup asking you which branch should the existing children be part of.

<figure><img src="/files/DoVv8YnXSRzXtKdrGm8S" alt="" width="375"><figcaption></figcaption></figure>

This is because **Switch Case** node breaks the flow into 2 or more separate branches, **which never merge**.

{% hint style="warning" %}

### Deleting Switch Case node

If you plan to delete the **Switch Case** node, keep in mind that it will **delete the whole flow** **below** the current Switch Case node as the system does not know which branch to connect to the parent node.
{% endhint %}

### Properties Panel

<table><thead><tr><th>Field</th><th width="511">Description</th><th>Required</th></tr></thead><tbody><tr><td>Node name</td><td><a href="/pages/jJ1qO0Ju8d7VFyPB2Jy3"><mark style="color:blue;"><strong>Checkout Node name</strong></mark></a></td><td>true</td></tr><tr><td>Switch Value</td><td>The value which needs to be checked in the Switch condition.<br><br>This can also be a Magical Autocomplete.</td><td>true</td></tr><tr><td>Switch Value Type</td><td>The datatype of the Switch values to be typecasted into.</td><td>true</td></tr><tr><td>Cases</td><td>A list of cases to be checked, else default case.<br><br>Each case creates a new branch in the Flow Builder.</td><td>true</td></tr></tbody></table>

### Returns

`condition` - The boolean result of the condition at runtime. You can access this using Magical Autocomplete (Eg. `$.<node_name>.condition`) in any node below this node.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.cosmocloud.io/flow-builder/node-types/conditional-nodes/switch-case.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
