# Chat Bot Basics

### Overview

Chat Bots manage automated phone call conversations that are part of a user's [Journey](../concepts/sessions). They can be used as [Events](../studio/studio/events) to start a Journey or started as part of an Action Chain.

Chat Bots provide a way to tie text messages into a user Journey, making them a crucial part of [call deflection](../concepts/sessions), sending timed reminders, and otherwise following up with users.

> 📘 Once an app is in production, is there a way to check on the status of the sent text messages? The status of outgoing text messages sent from all Apps within an Organization can be found in the Console, in the **SMS** tab when examining an application under **App Health**. This provides insight into important information such as which and how many text messages were successfully delivered. For more information, see [Console](../../console/console#app-health).

### Preparing the Web Page for the Chat Bot

The simplest example is to create a Chat Bot triggered from a Web Page, displaying information from the fields and to a phone number previously stored by the App.

Since the Chat Bot is triggered from a Web Page, first a [simple form](https://github.com/airkit/airkit-docs/blob/master/docs/v18-4/form-basics.md) must be created.

In this example, the user will complete the form with their name and phone number. For each of these fields, a variable will be created automatically:

![organizing info](https://2599974655-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIRF6etABDVMr59RdpyGw%2Fuploads%2Fgit-blob-5d7ff23b9fef04e792a3891f64390dbe48d9389c%2Fchat-bot-basics-v184-0.png?alt=media)

When the user clicks the “Track my order” button, an SMS will be sent to their phone number.

Three Actions must be added to the button for it to trigger the Chat Bot:

1. [Set Actor](../concepts/actors): to set the variable that will indicate the App to which number the Chat Bot must be sent
2. [Initialize Actor:](../actions/the-initialize-actor-action) to set the values for the current Actor in the Journey
3. [Start Chat Bot](../actions/the-start-chat-bot-action): to run the selected Chat Bot

![organizing info](https://2599974655-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIRF6etABDVMr59RdpyGw%2Fuploads%2Fgit-blob-b61e04eb0d2b31ec8f838f073b9a0c79afbfe3b2%2Fchat-bot-basics-v184-1.png?alt=media)

### Creating the Chat Bot

Chat Bots are created from the [Chat Bots Builder](../studio/studio/builder-bar/chat-bots-builder).&#x20;

Click on the '+' sign next to the Chat Bots and then select **Create Blank** or a Chat Bot Template.

![](https://2599974655-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIRF6etABDVMr59RdpyGw%2Fuploads%2Fgit-blob-3dece896c264e82556f6fe3aeb4ffdfd9d35c67f%2Fchat-bot-basics-v184-2.png?alt=media)

From the Chat Bot level, in the **General** tab in the Inspector, add a Variable of type Text and rename it to "fullName". This way, you’ll be able to use the user’s name in the SMS.

![](https://2599974655-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIRF6etABDVMr59RdpyGw%2Fuploads%2Fgit-blob-fc01fe7e11d7234afed12f47914b9ef32bd6e26f%2Fchat-bot-basics-v184-3.png?alt=media)

Add a Decision Menu and type the text that the SMS will display. Select **Expression** and enter the recently created `fullName` Variable so that the user is greeted by their name.

> 🚧 When creating SMS experiences, bear in mind that Airkit won't allow for the sending of the same text message to the same phone number multiple times within a 30-minute period.

Then enter the Decision Options the user will receive upon following the Chat Bot indications.&#x20;

![](https://2599974655-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIRF6etABDVMr59RdpyGw%2Fuploads%2Fgit-blob-87c8a172dc86743844dc26c5002b89ffa247c029%2Fchat-bot-basics-v184-4.png?alt=media)

We recommend adding transparent naming to all Chat Bot components to easily connect the Decision Options to each expected result.

### Tying Variables

So that the `fullName` Variable created in the Chat Bot can reproduce the value entered in the “Name” input field, the Variable needs to be bound.&#x20;

Go back to [Web Flows Builder](https://docs.airkit.ai/?q=web-flow-builder) and in the Start Chat Bot action of the "Track my order" Button, an Input field will be displayed for you to enter the Variable:

![organizing info](https://2599974655-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIRF6etABDVMr59RdpyGw%2Fuploads%2Fgit-blob-1862fb2ddeda85b0bc5b55528464cbf947c03c79%2Fchat-bot-basics-v184-5.png?alt=media)

Now the **Expression** tag in the Chat Bot will retrieve the name entered by the user when the SMS is triggered.
