# Building a Workflow for the Web Chat Widget

**Introduction**

In Gymini, the web chat widget is a powerful tool that facilitates direct communication with your leads through your website or within the Gymini ecosystem. This guide will walk you through the process of building a workflow for the web chat widget.

**Step-by-Step Guide**

**Step 1: Setting Up the Trigger**

* **Navigate to Automations**: In your Gymini sub-account, go to the "Automations" tab on the left sidebar.
* **Create a Workflow**: Click on "Create a Workflow" and start from scratch.
* **Define the Trigger**: Set the trigger as "Customer Replied" and filter it down to the "Web Chat Widget" reply channel.
* **Name the Workflow**: Label the workflow appropriately, such as "Chat Widget Submission".

**Step 2: Internal Notifications**

* **Add an Action**: Create an action to notify a user in the system when a lead submits a form through the chat widget.
* **Notification Methods**: Choose between app notification, email, or SMS to notify the user. The app notification requires the user to have the Gymini app installed and logged in.
* **Include Details**: In the notification, include details such as the lead's name and the message they submitted in the chat widget form.

**Step 3: Configuring the Chat Widget**

* **Access the Widget Settings**: Go to "Widget Window" in the chat widget settings to view and configure the fields that the lead needs to fill out.
* **Field Options**: You can ask for details such as name, mobile number, and message. Optionally, you can add an email field.

**Step 4: Customer Notification**

* **Create an SMS Action**: Set up an action to send an SMS to the customer thanking them for their message and informing them that someone will reach out shortly.
* **Personalize the Message**: Use custom values to personalize the message, including the lead's first name and your business name.

**Step 5: Testing the Workflow**

* **Test the Chat Widget**: Go to your funnel builder and test the chat widget on your booking page to see how it works.
* **View the Submission**: After testing, you can view the chat widget submissions in the "Forms" section under "Submissions" in "Sites".

Once you have a chat widget set up, you'll want to configure a Workflow Trigger to notify when a conversation is initiated via the chat widget. <br>

To do this, the trigger event should be "**Customer Replied**" with a filter for "**Reply Channel**" set to "**Chat Widget**" like this:

[![](https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/48201439334/original/lrVE3jfLHaBth2mpaYxPfLKBvLltQUEUxQ.gif?1647282141)](https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/48201439334/original/lrVE3jfLHaBth2mpaYxPfLKBvLltQUEUxQ.gif?1647282141)

\
**Please Note:**

<pre data-overflow="wrap"><code><strong>Every "Reply channel" will require its own respective trigger. For the example above we are only using "Chat Widget", if you wanted to use you would need to setup a NEW trigger and or workflow for that specific event.
</strong></code></pre>

Next hit the **+ >** Search for **"internal notifications" >** You can select from 3 options:

**1.** Email - Send email to a specific Users or custom email

**2.** In-app notification - Send a notification via the web app or mobile app to a specific Users or all

**3.** SMS - Send SMS to a specific Users or custom number&#x20;

**Quick Tip:**&#x20;

<pre data-overflow="wrap"><code><strong>Use the "{{Message Body}}" custom value in your notification email/text to display the message that the user entered into the chat widget.
</strong></code></pre>

<figure><img src="https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/48201451671/original/FEw0WTJHBjiryTFwJq5sfXtAx1noAfhfvQ.gif?1647284127" alt=""><figcaption></figcaption></figure>

**Tips**

* **Notification Redirect**: For app notifications, specify a redirect page in the app where the user will be taken when they click on the notification.
* **Phone Number**: Ensure you have a phone number purchased in Gymini to send SMS notifications.
* **Publish the Workflow**: Remember to publish the workflow to make it live before testing it.

**Conclusion**

Building a workflow for the web chat widget in Gymini enhances your ability to communicate efficiently with leads, providing a streamlined process for both internal notifications and customer interactions. Make sure to test your workflow thoroughly to ensure it operates as intended.
