# Flows

## **What are conversational flows?**

The sequences of cells inside the Workspace are called conversational flows. They're part of your virtual agent's knowledge base. Before building your flow,  it's important to learn about all the components that are part of the dialog.

Inside the Dialog Manager, you can find the following sections:&#x20;

* **Workspace:** where the flows are built
* **Repositories:** store the flows and cells (Intents, Entities, Services, and Answers) created in the Workspace&#x20;
* **Training:** place to train the virtual agent and check previous trainings.

To start building your virtual agent, you will have to choose a flow. These are the four types available in Syntphony CAI:

* [Welcome ](#welcome)
* [Not Expected ](#not-expected)
* [User Journey ](#user-journey)
* [Jump ](#jump)

Let's learn more about them!

### Welcome

This is an **optional** flow with one or more cells. For starters, you may find it easier to open a dialog with greetings in a welcome flow.

You can start your Welcome flow with a simple Answer (that can be evaluable or transactional), Rule, Code, or Service cell. After these, you can add any of the cells available in the Dialog Manager, including Intent, Entity, Input, Jump, and the End cell, as it may be a reusable flow.

The Welcome flow can be useful in different ways, depending on the channel being used and the business needs.

#### **App**

If your virtual agent is using an app channel, where the user is already logged in, this flow can help segment different user groups through rule cells, for example, which will allow you to deliver a different welcome message for each group.&#x20;

<figure><img src="/files/vRsn1HG4Yj3Fjufyc7Vu" alt="" width="563"><figcaption></figcaption></figure>

#### **WhatsApp**

Now, if the channel doesn’t start the dialog and depends on the user input to start a conversation (like in the WhatsApp case), the welcome flow can aim to query, using a service cell, the customer's telephone number, identify its segment and disambiguate it to deliver different answers.

<figure><img src="/files/eVyWc0D8lM3oiIbeJpLM" alt="" width="563"><figcaption></figcaption></figure>

#### **Web**

In web channels, the welcome flow can aim to change the behavior of the channel, using cell code, and store user information from *open* to *hidden context*. In sequence, the virtual agent delivers sequential responses to the user.

<figure><img src="/files/bJ4ltpF8BPnaXJjAjE2V" alt="" width="563"><figcaption></figcaption></figure>

### Not Expected&#x20;

The not expected flow is a fallback answer (also known as idk) executed when the virtual agent doesn’t understand the user’s context. It works as a miniflow with one or more cells. **It’s mandatory and cannot be deleted**.

#### **Custom answers**

You can set your virtual agent to deliver different Not Expected answers for different segments of customers using Rule cells.

<div><figure><img src="/files/Dawsd60aW8ADKVounZQi" alt="" width="563"><figcaption><p>Using Rule cells to deliver segmented Not Expected answers</p></figcaption></figure> <figure><img src="/files/5Yg3rZ3vtT7kjQLuPwq7" alt=""><figcaption><p>Using Service cell to identify users and deliver custom answers</p></figcaption></figure></div>

It’s also possible to query the costumers' segment to custom the answers by its segment (if it’s a regular costumer or premium, for example) using a Service cell.

You can also use Code cells to remember how many times the user has gone through a certain flow and then use Rule cells to disambiguate and deliver variable answers.&#x20;

<figure><img src="/files/iuhX6lnV6LhWlASZyvLM" alt="" width="563"><figcaption></figcaption></figure>

Learn how to [create variable answers with Code and Rule cells](/user-guide/build-dialogs/dialog-cells/rule/variable-answers-using-code-and-rule-cells.md).

### User Journey&#x20;

More robust option for building the dialog with all the conversational tools that Syntphony CAI has to offer. It must start with an Intent cell, whether it is new or from the list, in this cases Syntphony CAI searches on the repository for intents that had already been created.

{% hint style="info" %}
For a better performance, **we recommend to not exceed 100 cells in one dialog flow**. If you need to add more cells, you can either create new flows and use the [Jump](/user-guide/build-dialogs/dialog-cells/jump.md) function. 😉
{% endhint %}

### Jump&#x20;

This can be a complementary flow. Some flows may use a common journey, like for example when you need to validate or register a user, which may be needed in different flows such as open a ticket, follow its status, to cancel it, or even to leave a suggestion or a complaint.&#x20;

Instead of repeating the same cells in all these flows, you can simplify it by just adding a Jump cell that will lead to the Jump flow “user\_validation”. After what, it will go back to the original flow, by default, and continue from there.

Example: In the image below, we used a Code and Rule cells to disambiguate the flow when users try to reach for a human assistance during business hour and after that.&#x20;

<figure><img src="/files/lHL8TEeW5WYpaycGbvM7" alt="" width="563"><figcaption></figcaption></figure>

In the first case, an End cell was added after the "talk\_agent" answer cell. If users follow this route, the flow stops there. Whereas, if they go through the other path, they will go back to the origin flow.

{% hint style="info" %}
If you don't want the conversation to go back to the origin flow after the jump cell, simply add an [**End cell**](/user-guide/build-dialogs/dialog-cells/end.md) to the Jump flow where you want it to end. **Important:** if you have other cells in your origin flow after the jump cell, they won't be delivered.
{% endhint %}

When you jump to a User Journey flow, the first cell, an Intent, is ignored. If you need to use this Intent, add it to the origin flow.

Any flow can be edited (pencil icon) and deleted (trash can icon).

<img src="/files/CuLkWJ9pfDwQAGiuBFjQ" alt="You can access any created flow by clicking on the eye icon" width="563">

{% hint style="danger" %}
**Important:** Deleting a flow is an irreversible action.&#x20;
{% endhint %}

## Hide and Reveal Flow Function

<img src="/files/dCx7Yxifo8bR5XZetUdu" alt=" In the colored sidebar of each cell, you trigger the function" width="563">

These two functions are very useful for improving the visualization of flows with many branches.

On the right side of each cell, there is a colored sidebar. Yellow for Intent, blue for Answer and pink for the others (Entity, Code and Rule).

Click on the sidebar of any cell to hide the following cells:

![Same flow as above, after having activated the hide function in the first cell](/files/zdfVlmOg1DkUDMaOksYV)

{% hint style="warning" %}
**Important:** This function does not occur in End, Not Expected cells and some types of Jump (only those located at the ends of the flows), simply because they are always positioned at the end of the flows.
{% endhint %}

Once you are familiar with the most important features of Dialog Manager, it's very easy to create dialogs. A few reminders:

* Flows that don’t start with Intents can only be accessed through jump or logical routing from other flows.
* Every flow must end with an answer. If a flow ends with a jump to another flow, the other flow must end with an answer

## Remove and Reconnect Cells **m**odal

If you need to delete one or a sequence of cells, hover the cell you want removed and click on trash can icon.

<figure><img src="/files/DfIHzSv3TbJ8OviClCnI" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
The cell for Not Expected answer might disappear depending on the cells you are removing. They reappear when reconnecting the cells again.
{% endhint %}

If you choose to remove only the selected cell and not their subsequent siblings, the flow will have disconnected cells that you will have to reconnect.

![Disconnected cells](/files/IzntLnqJH4Fn4vOQshyi)

To reconnect those cells, you will have to link them. To see if the link is possible, click on one of the magnets that appear. Possible links will appear as green magnets. In this case, just click on the two magnets to connect two cells, or select the third cell to go in the middle. Impossible links will appear as red magnets. In this case, you will have inserted a cell between them to reconnect the flow.

**To reconnect cells, you should:**

**1) Click on the “add cell” button (plus icon) of the first cell.**

![](/files/RozWr4OGvxHv5ZI30XKs)

**2) After that, you can create a cell or select one from the repository.**

![](/files/TGe08Zme1Zu6qNJOVKQ3)

**3) If there is an available endpoint, the link will happen automatically.**

![](/files/LjkcmskOAbqtVDrUoHA2)

**4) If there is any branch that is not connected, you can link it to an available endpoint or remove it.**

![](/files/DUzD207taA3JOrUUHIzM)


---

# 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.conversational-ai.syntphony.com/user-guide/build-dialogs/flows.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.
