> For the complete documentation index, see [llms.txt](https://docs.tangramapps.com/en/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tangramapps.com/en/flow/nodes/switch.md). Agents can also search and read this documentation through its [MCP server](https://docs.tangramapps.com/en/~gitbook/mcp).

# SWITCH

Conditional judgment, Multiple outputs

<div><figure><img src="https://1809556891-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNmASc52mbS5BH4kcxCHP%2Fuploads%2F6JstCefbeZTRSqudiWZZ%2Fimage.png?alt=media&amp;token=b24e26a2-8c19-43da-8212-8efcdf3473ef" alt=""><figcaption><p>UI</p></figcaption></figure> <figure><img src="https://1809556891-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNmASc52mbS5BH4kcxCHP%2Fuploads%2Fy3T5c1awYxYojfDKFXbO%2Fimage.png?alt=media&amp;token=ce190343-787d-4fa6-9723-1a97a8b67cf4" alt=""><figcaption><p>Config Form</p></figcaption></figure></div>

### Judgment logic

```
1 ( A and B and ... ) or ( C and ... ) or ...
or
2 ( A and B and ... ) or ( C and ... ) or ...
or
3 ...
```

### Demo

<figure><img src="https://1809556891-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNmASc52mbS5BH4kcxCHP%2Fuploads%2FT4ONaLuSMoNAKbm3lh7h%2Fimage.png?alt=media&amp;token=b8c1a0d2-86ca-4c26-a370-45899b9a39bf" alt=""><figcaption></figcaption></figure>

Set up a random array and count the number, display different message texts based on judgment logic.

<figure><img src="https://1809556891-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNmASc52mbS5BH4kcxCHP%2Fuploads%2FTXywz7jVIyvqsWkxnLoS%2Fimage.png?alt=media&amp;token=c9a09ea0-097d-4386-ba30-4c2b525fefa1" alt=""><figcaption><p>Condition 1</p></figcaption></figure>

<figure><img src="https://1809556891-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNmASc52mbS5BH4kcxCHP%2Fuploads%2FgcfxBIaDZAwi5hLHmewR%2Fimage.png?alt=media&amp;token=71401dbe-ec87-4bae-bb81-f0181c2ce093" alt=""><figcaption><p>Condition 2</p></figcaption></figure>

<figure><img src="https://1809556891-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNmASc52mbS5BH4kcxCHP%2Fuploads%2FVka82r3f5ZlgSocGU3x3%2Fimage.png?alt=media&amp;token=31e51986-9f64-4039-94b2-c44c38eacd29" alt=""><figcaption><p>Condition 3</p></figcaption></figure>

Each condition corresponds to a branch.

### Audit logs

After the job is executed, the actual judgment logic can be viewed in the details.

<figure><img src="https://1809556891-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNmASc52mbS5BH4kcxCHP%2Fuploads%2FvPrDbYMGQ0FBhh2iBIVI%2Fimage.png?alt=media&amp;token=b9bc03bd-10bd-4797-bfef-4822e1e759c0" alt=""><figcaption></figcaption></figure>

<figure><img src="https://1809556891-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNmASc52mbS5BH4kcxCHP%2Fuploads%2FqNOThZivD2S4osOXB9jf%2Fimage.png?alt=media&amp;token=31521346-28f0-49e0-828f-e5cc6d983af1" alt=""><figcaption></figcaption></figure>

### Judgment type

Same like [IF](https://docs.tangramapps.com/en/flow/nodes/if.md#judgment-type).
