# AI Based Flow

With the **AI Bot Builder**, you can create smart, personalized conversations that help your business engage with customers 24/7. Whether you're building a bot to handle support queries or answer FAQs, the Flow Builder gives you full control—without needing to write a single line of code.

This guide walks you through everything you need to know to set up a new flow, define how your bot should behave, and create natural conversations that match your brand’s tone and goals.

Let’s see how we can create AI flow in Gallabox.&#x20;

1. From the homepage go to Bots. Choose the Bot under which you would like to add an AI flow. Click on 'Add New Flow' at the top right corner. Choose the option 'AI Based Flow'.

<figure><img src="/files/4PsmsegVOtuhZTS41NaO" alt=""><figcaption></figcaption></figure>

2. Enter the name for the flow, choose if you want to trigger the bot flow for a specific keyword or for any keyword. Define the Custom Configurations as per your business needs. Click on Create.&#x20;

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

3. Once your flow is created, the next important step is to **define the Role and Goal of your chatbot**. These two fields help shape the bot’s personality, behavior, and purpose—guiding both how it communicates and what it tries to achieve during conversations.

{% tabs %}
{% tab title="What is the Role of the Bot?" %}
The **Role** describes the bot’s identity, function, and how it should behave during interactions. Think of this like a job description or the "persona" of the bot.

When defining the **Role**, consider:

* Who the bot is (e.g., a support assistant, a product expert, a friendly guide)
* What kind of queries it should handle
* How it should speak (tone, level of formality)

**Examples:**

* “Acts as a friendly assistant to help customers check order status, track deliveries, and manage returns.”
* “Behaves like a professional product consultant, helping users choose the right software plan.”
* “Guides new users through onboarding, answers FAQs, and encourages feature adoption.”
  {% endtab %}

{% tab title="What is the Goal of the Bot?" %}
The **Goal** explains what outcome the bot is expected to achieve. This could range from answering common questions, to reducing support load, to converting leads.

When writing the **Goal**, focus on:

* The core objective of the bot
* How it supports your business or team
* What success looks like

**Examples:**

* “Reduce the number of repetitive support queries handled by agents by 60%.”
* “Guide new users through setup and ensure they complete onboarding within 24 hours.”
* “Answer frequently asked questions to improve user satisfaction and reduce wait times.”
  {% endtab %}
  {% endtabs %}

Once you define the role and the goal of the bot, click on save changes.&#x20;

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

4. Now it is time to provide the Instructions to the Bot. Switch to 'Instructions' Tab. These help your bot handle specific scenarios like failure, query not found etc.

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

5. When the instructions are set, you can proceed to add Actions. They allow you to trigger or receive information from third-party services, or assign the conversation to a Gallabox user. Choose from API Call or Assignment, make sure the toggle switch is on for 'Process in Background', and enter the details.&#x20;

{% tabs %}
{% tab title="API Call" %}
The **API Call Action** allows you to do simple actions—like fetching values from google sheet.&#x20;
{% endtab %}

{% tab title="Assignment" %}
Instead of handling every conversation manually, you can set up an **Assignment Action** to route conversations to a selected **team** when specific rules are met.&#x20;

For example, if a user has a question that the AI bot can't answer or mentions a specific keyword like "pricing," you can assign that chat to your **Sales Team** instantly.

<table><thead><tr><th width="245.6666259765625">Field</th><th>What to Enter</th></tr></thead><tbody><tr><td><strong>Action Name</strong></td><td>A clear name for your rule. Example: <code>Assign to Sales Team</code></td></tr><tr><td><strong>Action Type</strong></td><td>Choose <code>Assignment</code></td></tr><tr><td><strong>Process in Background</strong></td><td><em>(Keep this checked to auto-assign without interrupting the user)</em></td></tr><tr><td><strong>Assign Conversations To</strong></td><td>Select the team that should handle these queries — e.g., <code>Sales Team</code></td></tr></tbody></table>
{% endtab %}
{% endtabs %}

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

{% hint style="info" %}
This action can now be used inside instructions by typing `@get_order_details` to insert it directly into your bot flow.
{% endhint %}

6. Add DOCX, PDF, MD, or TXT resources (up to 15MB) for your bot to reference. This enables it to provide information from documents like product manuals, company policies, FAQs, and pricing documents.

{% hint style="danger" %}
Only textual information can be uploaded. If you uploaded an image, it might show error.
{% endhint %}

<figure><img src="/files/3mGrZS7TpcZTgLLXZhMf" alt=""><figcaption></figcaption></figure>

7. You can display a custom message when AI takes longer than 10 seconds to respond. Also you can enable the AI to analyze and respond to images sent by users. This allows your bot to handle visual inputs like photos or screenshots intelligently. They are available under settings.&#x20;

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

8. Once you everything is added, click on Publish button to make the AI bot flow start interacting with your customers.&#x20;


---

# 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.gallabox.com/bots/flow-in-the-bot/ai-based-flow.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.
