# AI-Powered Chat App

## **Setting Up Your Chatbot Integration Using Buzzy and Make/n8n**

This guide will walk you through setting up a chatbot integration between **Buzzy** and **Make** using a **Make Blueprint** (we also have a n8n option too). Check out the video below to get an overview of the process.

{% embed url="<https://youtu.be/6WLEiRV-AaM>" %}

***

### **Step 1: Get Your Buzzy User ID and API Token**

To connect your Buzzy app with Make (or n8n, Zapier etc), you need to retrieve your **Buzzy User ID** and **API Token**.

1. Log into **Buzzy Workspace**.
2. Click on your profile in the top right corner.
3. Navigate to **Developer**.
4. Copy both:
   * **Buzzy User ID**
   * **Secret API Token**

#### **Best Practices**

* **Use a dedicated API user**: Create a new user and assign them as an **owner/author**. This ensures a **stable** API connection as this user will never **log out** of Buzzy.
* **Token expiration warning**: If you **log out** of this API user, the token will become invalid.
  * To avoid this, use Buzzy's **Login API** with the user’s email/password to **dynamically fetch a token**.
  * More details: [Buzzy API Login Docs](https://docs.buzzy.buzz/rest-api/buzzy-rest-api/rest-api/login)

***

### **Step 2: Copy the Buzzy Template App**

To speed up development, start with the **pre-built Buzzy template**. If you haven't already grabbed a copy of the app:

1. Go to the [**Buzzy template**](https://app.buzzy.buzz/app/3702d99d7ac3e3a578559cf4/cd3d3f61ca1be15dfc1dcbc2/wR9rXzwbq8aHfB8LPnfq7hr5) **of the AI Chat app.**
2. Click **"Use Template"** to create a copy in your own Buzzy Workspace.

***

### **Step 3: Create a New Make File**

1. Open [**Make**](https://www.make.com/en).
2. Create a **new scenario** (Make file).
3. Download the blueprint (see below)
4. In Make create a new Scenario, it should be blank, click the Import Blueprint\ <img src="https://1771273900-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3HPEoFCyP7Q88dV3CmqD%2Fuploads%2FpJnrktaDSSrVCznenbRJ%2FScreenshot%202025-02-11%20at%203.15.11%E2%80%AFpm.png?alt=media&#x26;token=baf03dfe-6083-4619-8be2-fbcd924ebdd5" alt="" data-size="original">
5. You should see your chat flow in Make:&#x20;

   <figure><img src="https://1771273900-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3HPEoFCyP7Q88dV3CmqD%2Fuploads%2F7LDr3JFoYdLAI0u4JFM5%2FScreenshot%202025-02-11%20at%203.16.36%E2%80%AFpm.png?alt=media&#x26;token=63c1c5e2-f94f-4af4-bf10-4166f04b17ea" alt=""><figcaption></figcaption></figure>

{% file src="<https://1771273900-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3HPEoFCyP7Q88dV3CmqD%2Fuploads%2FM1k7a1wY1YZR9BJdJd02%2Fblueprint%20(2).json?alt=media&token=154037ff-b0c3-41b7-b07c-4aaa1b9732c3>" %}
Download this .json file to use in Make
{% endfile %}

### **Step 3.1: (optional) Create a New n8n File**

Buzzy will work with other flow based tools like Zapier and n8n here's an example n8m file you can use as an alternative to Make, so instead of Buzzy calling Make, you'd just be changing the webhook target to point to your n8n workflow.&#x20;

<figure><img src="https://1771273900-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3HPEoFCyP7Q88dV3CmqD%2Fuploads%2FRuO8aZ8qEmFzVbPvIJDX%2FScreenshot%202025-05-01%20at%2012.33.27%E2%80%AFpm.png?alt=media&#x26;token=9f530a66-726d-4184-8e22-d4ea7451817f" alt=""><figcaption></figcaption></figure>

{% file src="<https://1771273900-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3HPEoFCyP7Q88dV3CmqD%2Fuploads%2F6K3B5PNTY0C3xL7JCdwW%2Fbuzzy_chatbot_n8n_example_v1.json?alt=media&token=3a8caa79-a2d3-4a3a-beef-6028a5e79637>" %}

***

### **Step 4: Set Up the Webhook**

The **webhook** is the connection point between **Buzzy** and **Make**.

1. In **Make**, locate the **webhook module**.
2. Click **"Add a new webhook"**.
3. Copy the **generated webhook URL**.
4. You'll use this URL in **Buzzy Datatable rules** (next step).

***

### **Step 5: Configure Buzzy Datatable Rules**

The **Buzzy Datatable rules** will call **Make** when specific actions happen.

#### **Rule 1: Chat Creation**

This rule **creates a new chat** when a row is submitted in the **Chat** datatable.

1. Navigate to **Buzzy** > **Chat Datatable**.
2. Go to **Properties** > **Rules**.
3. Add a **new rule**.
4. Configure it as follows:
   * **Trigger:** When a row is **submitted**.
   * **Action Type:** `sendJSON`
   * **Call Type:** `[POST]`
   * **API Endpoint:** **Use the Make webhook URL from Step 4**.

**JSON Payload:**

```json
[{
  "chatID":"{{{_id}}}", 
  "messagesMicroAppID":"{{{messages}}}", 
  "action":"createChat", 
  "buzzyAPIEndpoint":"https://worker.buzzycompany.com/api",
  "buzzyAPIUserID":"<your Buzzy API User ID>", 
  "buzzyAPIUserToken":"<your Buzzy API Token>", 
  "makeBuzzyAPIToken":"<your secret key>"
}]
```

{% hint style="success" %}
**Security Tip**\
The `makeBuzzyAPIToken` is a **private security key** to ensure that only your Buzzy app can call the webhook. Generate a **long random string** to use as this token.
{% endhint %}

***

#### **Rule 2: Sending Messages**

This rule **creates a message** when a row is submitted in the **Messages** datatable.

1. Navigate to **Buzzy** > **Messages Datatable**.
2. Go to **Properties** > **Rules**.
3. Add a **new rule**.
4. Configure it as follows:
   * **Trigger:** When a row is **submitted**.
   * **Action Type:** `sendJSON`
   * **Call Type:** `[POST]`
   * **API Endpoint:** **Use the Make webhook URL from Step 4**.

**JSON Payload:**

```json
[{
  "messageID":"{{_id}}", 
  "action":"createMessage", 
  "chatID":"{{embeddingRowID}}", 
  "buzzyAPIEndpoint":"https://worker.buzzycompany.com/api",
  "buzzyAPIUserID":"<your Buzzy API User ID>", 
  "buzzyAPIUserToken":"<your Buzzy API Token>", 
  "makeBuzzyAPIToken":"<your secret key>"
}]
```

***

### **Step 6: Testing the Integration**

Before launching, confirm that everything is working:

1. **Submit a chat in Buzzy**.
2. Check if **Make receives the webhook call**.
3. Ensure that the **AI service (e.g., OpenAI, Anthropic, R1)** is responding.
4. **Submit a message** and verify it **appears in Make and in the chat app interface**

***

### **Further Considerations**

Once the chatbot integration is working, you may want to expand its capabilities:

#### **Moving to Your Own Buzzy Deployment**

* If you’re planning to [**host your own instance of Buzzy**](https://docs.buzzy.buzz/working-with-buzzy/buzzy-deployment-and-app-stores), ensure that the **Buzzy API endpoint** points to your custom deployment.

#### **Publishing Mobile Apps**

* Consider **publishing** your chatbot as a [**mobile app on iOS and Android**](https://docs.buzzy.buzz/working-with-buzzy/buzzy-deployment-and-app-stores/apple-and-google-app-stores).

#### **Security Enhancements**

* Configure **permissions** on **Buzzy Datatables** to **restrict access**.
* Implement **Make security filters** to prevent **unauthorized requests**.

***

### **Final Thoughts**

By following these steps, you now have a **fully functional chatbot** powered by **Buzzy, Make, and an AI service**. This setup is **modular and expandable**, allowing you to **customize** it to your specific needs.

If you have any questions, check out the **Buzzy Docs**: [docs.buzzy.buzz](https://docs.buzzy.buzz/) or reach out to the **Buzzy Community** on **Discord**.

🚀 **Now, go build something amazing!**
