# Branch

## Overview

![](/files/-MIx_tb1hd7h6wfrGu4-)

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.](/files/-MIx_tb2d6rh-u-pyzXw)

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.](/files/-MIx_tb39gDMIN_o0hX-)

## 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.


---

# 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.incari.com/incari-studio/master/toolbox/flow-control/branch.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.
