> ## Documentation Index
> Fetch the complete documentation index at: https://koreai.mintlify.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Node Connections

Node connections define how the conversation flows between nodes in a dialog task. This article covers two key aspects of node connections: configuring If-Else conditions on sequence connections, and scoping sub-intents using node groups.

***

## Adding If-Else Conditions to Sequence Connections

The platform allows you to use If-Else conditions to configure node connections when you want the conversation to follow specific paths depending on specific information.

**Example:** In a Book a Flight dialog task, if the AI Agent detects 5 or fewer passengers, it presents the standard offer; otherwise it presents a promotional offer.

### Types of Conditions

* **If** - Directs the conversation on a specific path if specific criteria are met. Lets you configure Entity, Context, and Intent criteria.
* **Else** - Sets the node connection when the If condition criteria aren't met. Only allows you to configure the next node to connect to.
* **Else If** - Configures another set of criteria when the initial If condition isn't met. Lets you configure Entity, Context, and Intent criteria.

**Example use case:**

* If `PassengerCount` is greater than `5` → connect to the `Group Promotion` node.
* Else if `ArrivalCity` equals `London` → connect to the `London Destination Package` node.
* Else → connect to the `Standard Flight Booking` node.

### Navigate to Sequence Connection Conditions

Sequence connection conditions are available within the node configuration panel of all node types, under the **Connection Properties** tab.

<Note>Connection properties are available **only for the bottommost node** of any sequence.</Note>

<img src="https://mintcdn.com/koreai/jOYNsItv-PCInN06/ai-for-service/automation/dialogs/node-types/images/node-conditions-connection-properties.png?fit=max&auto=format&n=jOYNsItv-PCInN06&q=85&s=7d156e093aa9cd2c06176c4de0728391" alt="Connection Properties" width="508" height="832" data-path="ai-for-service/automation/dialogs/node-types/images/node-conditions-connection-properties.png" />

### Add If / Else Connection Conditions

Under the **Connection Properties** section, click **Add IF** or **Add Else If**. You can configure the conditional expression based on one of the following criteria:

<Note>In a conditional connection, if entity type, context type, or intent type is an array, then the operator "contains" is supported.</Note>

#### Entity

Compares an Entity node in the dialog with a specific value:

1. Select the **Entity** (based on the [Entity Node](/ai-for-service/automation/dialogs/node-types/entity-node#entity-node)).
2. Select an **Operator**: exists, doesn't exist, equal to, greater than or equal to, less than or equal to, not equal to, greater than, less than, or contains.
3. Enter a **Value** (not displayed when `exists` or `does not exist` are used as operators). You can enter a static value or a dynamic variable such as context, environment, or content — type the variable type followed by a dot (`.`) and select from the pop-up list.
4. In the **Then go to** dropdown, choose the node to connect to if the condition is met.
5. Click **Add Path Label** to label this conversation path.

**Example:** `PassengerCount (entity) greater than (operator) 5 (value)`.

<img src="https://mintcdn.com/koreai/jOYNsItv-PCInN06/ai-for-service/automation/dialogs/node-types/images/node-conditions-entity-node-if.png?fit=max&auto=format&n=jOYNsItv-PCInN06&q=85&s=3fcbc6c4beb807cb8a9c8ed3d010c722" alt="Entity node - If condition" width="353" height="285" data-path="ai-for-service/automation/dialogs/node-types/images/node-conditions-entity-node-if.png" />

#### Context

Compares a context object in the dialog task with a specific value:

1. Select the **Context** object. Follow the required syntax — see the [Context Object](/ai-for-service/automation/agent-flows#context-object) article for details.
2. Select an **Operator**: exists, does not exist, equal to, greater than or equal to, less than or equal to, not equal to, greater than, less than, or contains.
3. Enter a **Value** (not displayed when `exists` or `does not exist` are used as operators). You can enter a static value or dynamic variable.
4. In the **Then go to** dropdown, choose the node to connect to if the condition is met.
5. Click **Add Path Label** to label this conversation path.

**Example:** If `Passenger Type` (context object) equals `Infant`, trigger the node managing infant booking.

<img src="https://mintcdn.com/koreai/jOYNsItv-PCInN06/ai-for-service/automation/dialogs/node-types/images/node-conditions-on-context.png?fit=max&auto=format&n=jOYNsItv-PCInN06&q=85&s=d5d2b12aea1e545ce4d817144f2f142a" alt="Setting condition on context" width="356" height="314" data-path="ai-for-service/automation/dialogs/node-types/images/node-conditions-on-context.png" />

##### Add And/Or Logic

You can configure multiple context-based If conditions using And/Or logic. Within the same condition, you can use either one or the other — not both.

* **AND** - Both or all criteria must be met.
* **OR** - Either one or another of the criteria must be met.

Click the **+AND** or **+OR** button within the Context condition to add another criterion. Click the **"-"** sign to delete an existing criterion.

<img src="https://mintcdn.com/koreai/jOYNsItv-PCInN06/ai-for-service/automation/dialogs/node-types/images/node-conditions-on-context-and-or-logic.png?fit=max&auto=format&n=jOYNsItv-PCInN06&q=85&s=123aff91dbaac558a8534399aa981b80" alt="Add And/Or logic in Context based condition" width="388" height="314" data-path="ai-for-service/automation/dialogs/node-types/images/node-conditions-on-context-and-or-logic.png" />

**Example:** If `Passenger Type` equals `Infant` OR `Passenger Age` is less than or equal to `5`, trigger the infant booking node.

<img src="https://mintcdn.com/koreai/jOYNsItv-PCInN06/ai-for-service/automation/dialogs/node-types/images/node-conditions-on-context-and-or-logic-example.png?fit=max&auto=format&n=jOYNsItv-PCInN06&q=85&s=9c00969a6b2fe386bc13f4d42cbbeeba" alt="Example - And/Or logic in Context based condition" width="484" height="501" data-path="ai-for-service/automation/dialogs/node-types/images/node-conditions-on-context-and-or-logic-example.png" />

#### Intent

For **Entity nodes**, this criterion lets you select a follow-up intent that matches the user utterance to determine the next node. The `context.FollowupIntents` parameter is preselected — you can connect to a specific node if a follow-up intent exists or contains a specific value.

<img src="https://mintcdn.com/koreai/jOYNsItv-PCInN06/ai-for-service/automation/dialogs/node-types/images/node-conditions-follow-up-intent.png?fit=max&auto=format&n=jOYNsItv-PCInN06&q=85&s=aab84e065b2a65231fb5ccb752876c55" alt="Select Follow-up intent" width="354" height="271" data-path="ai-for-service/automation/dialogs/node-types/images/node-conditions-follow-up-intent.png" />

For **Message nodes**, you can choose `context.followupintent` as above, or select to wait for user input. Under the **Equals** dropdown, select which user input the AI Agent should wait for before connecting to the node set under `Then go to`.

<img src="https://mintcdn.com/koreai/jOYNsItv-PCInN06/ai-for-service/automation/dialogs/node-types/images/node-conditions-follow-up-intent-wait-for-user-input.png?fit=max&auto=format&n=jOYNsItv-PCInN06&q=85&s=190a8bb918b5ce167ec4c838cbd50707" alt="Follow-up intent - Wait for User Input" width="352" height="224" data-path="ai-for-service/automation/dialogs/node-types/images/node-conditions-follow-up-intent-wait-for-user-input.png" />

### Delete Conditions

Hover over a condition and click the **bin icon** on the top right to delete it.

<img src="https://mintcdn.com/koreai/jOYNsItv-PCInN06/ai-for-service/automation/dialogs/node-types/images/node-conditions-delete-condition.png?fit=max&auto=format&n=jOYNsItv-PCInN06&q=85&s=4c7dad4e980b17f4653ca1c51d923c00" alt="Delete condition" width="356" height="311" data-path="ai-for-service/automation/dialogs/node-types/images/node-conditions-delete-condition.png" />

### Node Type Applicability

* For all node types except Message and Agent Transfer, the only available Intent condition criterion is `context.FollowupIntents`.
* For **Message Nodes**, the Intent condition criterion provides two options: `context.followupintent` and `User Input`.
* **Primary Intent nodes** don't allow connection conditions at all — you can only choose the next node to connect to. Intent nodes that follow other nodes within a Dialog Task do allow connection conditions, but the Intent criterion only allows setting a follow-up intent using the context object.
* **Agent Transfer nodes** provide no options to connect to a subsequent node — this node ends the AI Agent's process and sets **End of Dialog** after the transfer.

***

## Sub-Intent Scoping Using Node Groups

Node groups define a group of nodes but are not part of the dialog flow. They are primarily used to scope sub-intents — controlling which sub-intents can be identified and executed while the user is at any node within the group.

See [Manage Node Groups](/ai-for-service/automation/dialogs/manage-dialogs#manage-node-groups) for the advantages of grouping nodes in a sequence.

### Add a Node Group

1. Open the dialog task where you want to add the group.
2. Group the nodes. See [Manage Node Groups](/ai-for-service/automation/dialogs/manage-dialogs#manage-node-groups) for steps.
3. Add, remove, edit, or delete nodes from the group at any time.

### Configure a Node Group

Node group configuration includes:

* **Scoping of Intents** - Define sub-intents available while the user is at any node in the group.
* **Sub-intent Training** - Train the sub-intent for recognition within this group.
* **Sub-intent Properties** - Define the behavior of the sub-intent.

#### Sub-Intent Scoping

1. Open the dialog task. Navigate to **More Options > Manage Groups**.

   <img src="https://mintcdn.com/koreai/h9KQONgzeiUMkrXj/ai-for-service/automation/dialogs/images/using-dialog-builder-manage-groups.png?fit=max&auto=format&n=h9KQONgzeiUMkrXj&q=85&s=1090131809d115cb980d5a63eef66128" alt="More Options - Manage Groups" width="1920" height="905" data-path="ai-for-service/automation/dialogs/images/using-dialog-builder-manage-groups.png" />

2. Click the Node Group you want to scope the intents for.

3. Click the **Sub Intent** icon.

   <img src="https://mintcdn.com/koreai/gLtNCSeAsIqqVQFw/ai-for-service/automation/dialogs/node-types/images/sub-intent-scoping-click-sub-intent.png?fit=max&auto=format&n=gLtNCSeAsIqqVQFw&q=85&s=c0eba6da8fddb4271d78a05774746f2e" alt="Sub Intent icon" width="482" height="851" data-path="ai-for-service/automation/dialogs/node-types/images/sub-intent-scoping-click-sub-intent.png" />

4. Click **+ New**.

   <img src="https://mintcdn.com/koreai/gLtNCSeAsIqqVQFw/ai-for-service/automation/dialogs/node-types/images/sub-intent-scoping-new.png?fit=max&auto=format&n=gLtNCSeAsIqqVQFw&q=85&s=57a7227983dc6abf01c50c4c15dd9082" alt="Sub Intent - New" width="481" height="847" data-path="ai-for-service/automation/dialogs/node-types/images/sub-intent-scoping-new.png" />

5. Provide a **Name** and **Description** for the Sub Intent, and click **Save**.

   <img src="https://mintcdn.com/koreai/gLtNCSeAsIqqVQFw/ai-for-service/automation/dialogs/node-types/images/sub-intent-scoping-sub-intent-name-description.png?fit=max&auto=format&n=gLtNCSeAsIqqVQFw&q=85&s=e081d27d16857cc373532b3b0a99fe54" alt="Sub Intent Name and Description" width="480" height="853" data-path="ai-for-service/automation/dialogs/node-types/images/sub-intent-scoping-sub-intent-name-description.png" />

Once added, you can train, set pre-conditions, fulfillment criteria, prompts, and behavioral properties for the scoped intent.

<img src="https://mintcdn.com/koreai/gLtNCSeAsIqqVQFw/ai-for-service/automation/dialogs/node-types/images/sub-intent-scoping-train-the-sub-intent.gif?s=fefc3e5ad4e5efce1cb6f535569c811c" alt="Sub Intent is added" width="482" height="850" data-path="ai-for-service/automation/dialogs/node-types/images/sub-intent-scoping-train-the-sub-intent.gif" />

You can also select an existing intent (dialog) and add it as a sub-intent.

<img src="https://mintcdn.com/koreai/gLtNCSeAsIqqVQFw/ai-for-service/automation/dialogs/node-types/images/sub-intent-scoping-add-existing-intent.png?fit=max&auto=format&n=gLtNCSeAsIqqVQFw&q=85&s=ea22291a4a40d29e4839ae9f0c132765" alt="Select existing dialog as Sub Intent" width="484" height="851" data-path="ai-for-service/automation/dialogs/node-types/images/sub-intent-scoping-add-existing-intent.png" />

#### Sub-Intent Training

1. Under **MANAGE SUB INTENT**, select the sub-intent you want to train.
2. Train it using:
   * **Machine Learning** - Add user utterances that should identify this sub-intent. You can also use the NER approach to annotate entities in utterances.
   * **Patterns** - Identify patterns in user utterances related to this sub-intent.
   * **Rules** - Define intent identification rules to trigger this intent.
3. Set **Intent Preconditions** — the sub-intent is identified only when the preconditions defined are available in context at the time of intent detection. These preconditions are instance-level and take precedence over component-level preconditions.

   <img src="https://mintcdn.com/koreai/gLtNCSeAsIqqVQFw/ai-for-service/automation/dialogs/node-types/images/sub-intent-scoping-pre-conditions.png?fit=max&auto=format&n=gLtNCSeAsIqqVQFw&q=85&s=df1a3379a7e24e3e87aaf365ef9c7d27" alt="Sub intent pre-conditions" width="478" height="601" data-path="ai-for-service/automation/dialogs/node-types/images/sub-intent-scoping-pre-conditions.png" />

#### Sub-Intent Properties

The **fulfillment** section defines actions when a sub-intent is identified:

1. **Context Variables** - Set key-value pairs to update session or context variables. Use the keyword `null` to reset values (spaces are ignored).
2. **Present a Message** - Optionally define a message to present to the user. Supports plain text, JavaScript format, and [Voice Call Properties](/ai-for-service/automation/agent-flows#voice-call-properties) where applicable.
3. **Context Output** - Define context tags to set when this intent is identified. The intent name is always set as output context by the system. Use `null` to reset values.
4. **Transition Flow** - Define how the dialog resumes after executing the sub-intent:

   * **Jump To A Node** - The dialog resumes from the specified node.
   * **Resume The Dialog** - The dialog resumes from the node where the intent was identified.

   <img src="https://mintcdn.com/koreai/gLtNCSeAsIqqVQFw/ai-for-service/automation/dialogs/node-types/images/sub-intent-scoping-sub-intent-properties.png?fit=max&auto=format&n=gLtNCSeAsIqqVQFw&q=85&s=51b02ff315bd68a833b6c93262a00ee7" alt="Sub intent properties" width="480" height="1000" data-path="ai-for-service/automation/dialogs/node-types/images/sub-intent-scoping-sub-intent-properties.png" />

### Implementation

For every identified sub-intent, the context object is updated with an array of objects containing sub-intent details (latest at the top):

* Name of the sub-intent
* Entities identified along with the sub-intent
* Name of the group the sub-intent belongs to (where applicable)
* Name of the node at which the sub-intent was identified

```json theme={null}
"identifiedSub-Intents": [
  {
    "intent": "Change Destination",
    "entities": {
      "destcity": "Delhi"
    },
    "groupName": "Entity Group",
    "identifiedAt": "to_date"
  },
  {
    "intent": "Weather Report",
    "groupName": "Entity Group",
    "identifiedAt": "destcity"
  }
]
```

The sub-intent executes if it is within the group scope, all input preconditions are satisfied, and the transition flow directs to the relevant node. Execution involves:

* Updating context variables as per the defined mapping.
* Setting the Output Context as per the defined mapping.
* Presenting the message to the user, if applicable.
* Continuing the dialog as per the transition flow (jump to node or resume from current point).
