Let’s explore the fundamental components (actions) that you can use to create powerful and customizable chatbots.
Event triggers
Triggers enable you to initiate specific actions based on user interactions with the chat widget. For example, an event trigger can act as the starting point for your flow. However, please be aware that many integrations do not support certain event triggers due to the nature of the application. For instance, most integrations do not support widget-related events such as “Chat window opened,” “Chat window closed,” “Before start new thread,” or “Custom event,” as these events are based on chat widget behaviors.
Supported events
- First Visit – This trigger activates when a customer visits your website for the first time
- Second Visit – This trigger activates when a customer has visited your website previously.
- Chat Window Opened – This trigger activates when a customer opens the chat window.
- Chat Window Closed – This trigger activates when a customer closes the chat window.
- Bot Menu Opened – This trigger activates when a customer opens the bot menu.
- Before start new thread – This trigger activates when a thread has not yet started or the current thread has ended.
- New Thread Started – This trigger activates when a customer starts a new thread by sending the first message or command to the chat.
- Custom Event – This trigger can be activated via JavaScript code (see instructions below).
Each trigger has additional options:
- Run once per thread: If enabled, this trigger will execute only once per thread.
- Run only if thread is not started: If enabled, this trigger will execute only if the thread has not yet started (i.e., no messages have been sent by the website visitor).
Custom Event trigger
You can activate a custom trigger whenever necessary by executing the following JavaScript code:
findallchat.sendCustomEvent('myCustomTrigger');Bot commands
Bot commands originate from the Telegram bot system, but you can also utilize them with our native live chat widget.
In the Telegram app, the bot command is the sole method to initiate a bot. When a user visits your bot in Telegram, they will see the Start button, which sends a /start command when pressed. Therefore, designing a chat flow for Telegram necessitates including the /start command.
If you use bot commands within the live chat widget, they will function identically to those in the Telegram app. The initial command will serve as the starting point, so when a user opens the chat widget, they will see the Start button. Pressing this button will initiate the thread.
Message
The “Message” action allows you to send a message to the customer. This message can include one or several images and may also contain buttons.
Additionally, you can trigger several actions within the “Message” action:
- Send a webhook
- Set visitor data (store user email, name, and phone number)
- Send data to a Google Sheet (requires Google Sheet integration)
- Send an email
- Send a Telegram notification
- Change the chat flow language
If you are expecting a response from the customer, you need to enable the “Wait for reply” option. You can also set validation for the input value, such as requiring email validation if you are expecting an email address. Please see the next article for details.
Handling user input
If you anticipate a response from the customer, you need to enable the “Wait for reply” option in the “Message” action.
Input validation
You can then optionally set a validation for the input value. For example, if you expect an email address in response to the message, you can set “Email” as the validation. Once validation is configured, you can attach actions to execute if the validation fails (using the “Message is invalid” port). If the input is valid, the action connected to the “Next” port will be triggered.
Saving input value to a variable
To store the value of user input, enable the “Save to variable” option located in the Actions section, and then choose the variable where the input value will be stored.
Forms
Please note that forms are supported only on native live chat and not on other channels. If you are using forms in your chat flow, you will need to implement some workaround logic using the “Condition” action to run a different flow subtree for platforms that do not support forms.
You can send a form directly to the live chat widget. Optionally, you can disable the main input field for the Form action to prevent sending messages until the form is submitted.
Additionally, you can save each form field value to a variable. To do this, enable the “Save response to variable” option in the Actions section. Then, select the variable to store and enter {fieldID} in the Data field.
Start another flow
You can initiate a new chat flow from the current one. To do this, you need to select the target chat flow and the action that will serve as the entry point.
ChatGPT Integration
ChatGPT integration is used to integrate OpenAI ChatGPT to your chat flow. To use this integration you need to have your own OpenAI API key. By default the API key from OpenAI integration will be used.
Important Notice: You must place Message with reply before ChatGPT integration to enable it to fetch customer input.
Training the ChatGPT
To train ChatGPT with your custom data, use the Instructions text field. Paste the information you want ChatGPT to know about your company or guidelines on how it should interact with customers. You can also utilize a preconfigured ChatGPT assistant to train the model with specific files. To create an assistant, visit https://platform.openai.com/assistants. Once you’ve created an assistant, copy the Assistant ID and paste it into the integration settings within the chat flow.
You can also create an AI assistant by navigating to the “AI Assistants” section in your settings. For further details, please refer to the following article.
Using custom functions
You can use custom functions to interrupt ChatGPT and execute a specific flow sub-tree in certain scenarios. For instance, you can create a custom function with a description like “if customer wants to buy a phone” and attach specific actions to it. Similarly, you can add a function with the description “if customer wants to contact the support team” and then link it to the “Invite agent” action.
Condition
A condition action lets you incorporate conditional logic into your chat flow. For instance, you can execute a specific chat flow sub-tree based on a variable’s value, the availability of agents, or the platform the visitor is using to chat with you.
This action has two ports for connecting subsequent actions: “true” (executes when the condition is met) and “false” (executes if the condition is not met).
Keyword matcher
This action requires ChatGPT integration. Please verify whether you have an active ChatGPT integration on the Settings / Integrations page. If not, this action will result in an error.
The Keyword Matcher action is akin to the Condition action, but it uses keywords for matching rather than exact conditions. You can create multiple keyword groups and assign subsequent actions to each group.
If a specific group is matched, the corresponding action will be executed. Additionally, you can link actions to the “No matched keywords” port to handle cases where no keywords are found in the user input.
There is also a special port for handling errors during requests to the OpenAI server, allowing you to define fallback actions.
Invite agent
This is a special action for allowing a customer to escalate the automated chat flow to a human agent. Please note that it is recommended to use the “Message with reply” action before the “Invite agent” action to ensure the customer’s input is passed to the agent dashboard.
Optionally, you can specify the department whose agents will receive the chat invitation.
Additionally, you can set a timeout, so if no agent connects to the chat flow within the specified time, the connected actions will be triggered.
And finally, you have the option to set an action after the “Invite agent” step. This action will execute once the agent exits the chat.
Variables
Variables are useful for storing data within the chat flow and enabling conditional logic. They can be either local or global. Local variables are accessible only within the current thread, whereas global variables can be accessed across all threads for the current customer.
Multilanguage support
You can implement a multilingual chatbot by incorporating additional languages into your chat flow. The initial language of the chat flow will depend on the client’s preferences. For a web browser, the language will be determined by the browser settings. For a Telegram flow, the language will be detected using the Telegram API. If the client’s preferred language is not available in your chat flow, the default language will be used.
Important notice: If you’ve added multiple languages to your chatflow, you’ll need to manually enter all data in each language. We plan to introduce an auto-translation feature in the future.
Important notice: If you want to use a single language other than English, please replace the English language with your desired language instead of adding it as an additional one. This will help avoid having texts, buttons, and other elements in both languages.
Testing your flow
With the testing tool, you can effortlessly verify the functionality of the chat flow without needing to connect it to the chat widget or any other channel.
Important notice: During the test run, the “Invite agent” action will display a limitation notice instead of actually inviting a chat agent.
Debugging the flow
During the test run, you can also enable the debug option. This will allow you to monitor variable values and actions in real time.