> For the complete documentation index, see [llms.txt](https://docs.incari.com/incari-studio/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.incari.com/incari-studio/master/toolbox/flow-control/branch.md).

# Branch

## Overview

![](https://2631170186-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MIspkFTPkuGkv4UgQGs-887967055%2Fuploads%2Fgit-blob-34e98833ad2efe9d6b8b881e135e388e26534130%2Fbranch-node.png?alt=media)

Like a branch on a tree, the **Branch Node** splits a single path into two diverging paths. Which branch of logic is executed depends on a single condition, which can itself be composed of multiple conditions. At a high level it basically means "*If this is true, do this; if not, do this.*" which sounds relatively simplistic, however, branching is a foundational concept of creating interactive logic, similar to using *if statements* in programming, and when combined with **Relational Expression**, **Pulse Flow** and **Logical Operator** **Nodes**, we can build incredibly complex systems.

## Uses

There are infinite uses for the **Branch Node**, however a very basic example would be a single **Input** condition, which triggers one of two functions. In the example below we use a **Variable** to represent whether the unit of measurement for distance is set to *km/h* or *mph*, and trigger functions to display data in the corresponding format.

![Basic example of the Branch node.](https://2631170186-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MIspkFTPkuGkv4UgQGs-887967055%2Fuploads%2Fgit-blob-eaae8a9a28e6b8770e510c9a43adbcc093f1a519%2Fbranching-example-simple.png?alt=media)

These *conditional statements* can be chained together and combined with other **Nodes**. Below is an example where the **Logic** checks:

1. If the passenger seat is occupied. If it is (*true*) then...
2. It checks if the passenger seat belt is fastened. If it isn't (*false*) then...
3. It sounds an alarm.

![An intermediate example of the Branch node.](https://2631170186-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MIspkFTPkuGkv4UgQGs-887967055%2Fuploads%2Fgit-blob-8ed570d7de897afef4ad49b587b9b8a4f3900a0c%2Fbranching-example-intermediate.png?alt=media)

## Inputs

| Input             | Type      | Description                                                           |
| ----------------- | --------- | --------------------------------------------------------------------- |
| *Pulse Input* (►) | **Pulse** | A standard **Input Pulse**, to trigger the execution of the **Node**. |

## Outputs

| Output    | Type      | Description                                                                   |
| --------- | --------- | ----------------------------------------------------------------------------- |
| `OnTrue`  | **Pulse** | Triggers the execution of subsequent logic if **Input** condition is *True*.  |
| `OnFalse` | **Pulse** | Triggers the execution of subsequent logic if **Input** condition is *False*. |

## External Links

* [*Condiitonal (computer programming*](https://en.wikipedia.org/wiki/Conditional_\(computer_programming\)) on Wikipedia.
