> For the complete documentation index, see [llms.txt](https://humley.gitbook.io/humley-studio/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://humley.gitbook.io/humley-studio/enhance-assistant/flow/flow-conditions.md).

# Flow Conditions

**Conditions** allow you to add logic using comparators (e.g. Equals To, Exists, Not Contains etc.) so that you can branch the Flow depending on end-users' answers, data passed back from external APIs, or values from within your own service.

Conditions are represented by two or more horizontally-connected boxes and further modules (or conditions) can be added below each one to create the different paths the conversation will take, depending on the conditions met.

### Add a Condition

1. To add a condition to a flow, click a '+' icon at the desired point on the flow canvas and select the *Add Condition* option.
2. Enter in the sidebar -

* **Name**\
  Name the Condition. All Condition & module names must be unique within the Flow.
* **Comparator** Choose a comparator that fits the logic you want to apply to the condition.\
  The description and fields available in the **Condition Values** section will change to fit the comparator e.g. the *Equals* comparator will need two values to compare against each other, where the *Else* comparator needs no values.
  * **Value 1**\
    The entity or variable to make a comparison against.

    Start typing in the *Search or Create* field to either -

    * Select an existing entity or variable
    * Create a new entity or unassigned variable\
      If you create an entity from here, it will have no values. Once you've finished building your Flow, you will need to add **Text Values** or **Pattern Values** to it.\
      If you create a variable from here, it will be unassigned. Once you've finished building your Flow, you may need to **Assign the Variable to an Entity**.
  * **Value 2**\
    The entity, variable, or text value you want to compare **Value 1** with.

    Start typing in the *Search or Create* field to either -

    * Add a free text value
    * Select an existing entity or variable
    * Create a new entity or unassigned variable\
      If you create an entity from here, it will have no values. Once you've finished building your Flow, you will need to add **Text Values** or **Pattern Values** to it.\
      If you create a variable from here, it will be unassigned. Once you've finished building your Flow, you may need to **Assign the Variable to an Entity**.

3. Click **Create Condition** in the sidebar.<br>

The new Condition will be shown on the Flow canvas, along with a default connected Condition, named 'Unititled' and with an Else comparator. This Untitled condition can then be edited or deleted if necessary.

### Add further Conditions

You can add further Condition boxes to an group of existing conditions in order to include more 'paths'.

1. Click one of the '+' icons above any of the existing conditions in the group you wish to add to and select the *Add Another Condition* option.
2. Follow the steps 2 & 3 of [**Add a Condition**](broken://pages/PO6GbcvpBl65VLARy62H) above.

N.B. The *Else* comparator can be present in just one condition within a group of conditions.
