# How to Send WhatsApp Templates via Tiledesk Webhook and HubSpot Workflow

#### Intro <a href="#intro" id="intro"></a>

Do you need to set automatic WhatsApp messages being sent to your selected audience based on the state of their deal your contact is in? Follow these 5 simple steps to achieve a complete flow entailing a HubSpot workflow integration with a conversation automation tool such as Tiledesk.

### 1. Connect WhatsApp Business API to Your Tiledesk Project <a href="#id-1-connect-whatsapp-business-api-to-your-tiledesk-project" id="id-1-connect-whatsapp-business-api-to-your-tiledesk-project"></a>

Follow the official Tiledesk guide to connect your WhatsApp Business API:\
[Tiledesk WhatsApp Integration Guide](/apps-and-integrations/whatsapp-business.md)

Once connected, you will be able to send and manage WhatsApp messages from Tiledesk.

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

### 2. Create a Webhook in Tiledesk Design Studio <a href="#id-2-create-a-webhook-in-tiledesk-design-studio" id="id-2-create-a-webhook-in-tiledesk-design-studio"></a>

Go to the **Bots** section in your Tiledesk console.

Click **Create from scratch**.

In the type dropdown, choose **Webhook**.

Once inside the Design Studio, find the **Webhook** button in the panel.

Click on the three dots next to the webhook button and select **Generate URL**.

Copy the generated URL: you will use it later in HubSpot.

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

### 3. Configure the Webhook Action in Your Bot[#](https://gethelp.tiledesk.com/articles/how-to-send-whatsapp-templates-via-tiledesk-webhook-and-hubspot-workflow/#3-configure-the-webhook-action-in-your-bot) <a href="#id-3-configure-the-webhook-action-in-your-bot" id="id-3-configure-the-webhook-action-in-your-bot"></a>

Connect a **Web Response** action to your Webhook button.

Configure the Web Response block with:

Response status: **200**

Response body (JSON):

```
{
  "phone": 
}
```

This acts as a gatekeeper to ensure that only valid phone numbers proceed.

<figure><img src="/files/9lQHgLrIqhl1p6IQYQZz" alt=""><figcaption></figcaption></figure>

### 4. Configure the WhatsApp Template Sending Action[#](https://gethelp.tiledesk.com/articles/how-to-send-whatsapp-templates-via-tiledesk-webhook-and-hubspot-workflow/#4-configure-the-whatsapp-template-sending-action) <a href="#id-4-configure-the-whatsapp-template-sending-action" id="id-4-configure-the-whatsapp-template-sending-action"></a>

From the **Actions** menu on the left, under the **Integrations** tab, select **Send WhatsApp**.

Drag and drop this action right after the Web Response block.

Edit the Send WhatsApp action:

**Phone number ID**: Insert the Phone Number ID available in your Meta for Developers account.

**Template**: Select the WhatsApp template already approved in your Meta account.

**Receiver phone number**: Insert the variable .

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

#### Add Web Response Blocks for Success and Error Paths[#](https://gethelp.tiledesk.com/articles/how-to-send-whatsapp-templates-via-tiledesk-webhook-and-hubspot-workflow/#add-web-response-blocks-for-success-and-error-paths) <a href="#add-web-response-blocks-for-success-and-error-paths" id="add-web-response-blocks-for-success-and-error-paths"></a>

Connect two **Web Response** blocks to the "Success" and "Else" exits of the Send WhatsApp action.

For the **Success** port:

Response status: **200**

Response body (JSON):

```
{
  "success": true,
  "message": "WhatsApp message sent"
}
```

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

For the **Else** port:

Response status: **400**

Response body (JSON):

```
{
  "success": false
}
```

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

### 5. Configure HubSpot to Trigger the WhatsApp Webhook[#](https://gethelp.tiledesk.com/articles/how-to-send-whatsapp-templates-via-tiledesk-webhook-and-hubspot-workflow/#5-configure-hubspot-to-trigger-the-whatsapp-webhook) <a href="#id-5-configure-hubspot-to-trigger-the-whatsapp-webhook" id="id-5-configure-hubspot-to-trigger-the-whatsapp-webhook"></a>

Log into your HubSpot account.

Go to **Automation** > **Workflows** (note: this feature is not available on free plans).

Click the orange **Create workflow** button in the top right corner.

Choose a **Deal-based** workflow.

#### Set Up the Trigger <a href="#set-up-the-trigger" id="set-up-the-trigger"></a>

For enrollment trigger, select:

**Has completed: Property value changed**

**Property name**: Deal Stage

**New Value**: Contract Sent (or any stage where you want the message triggered).

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

#### Add a Webhook Action[#](https://gethelp.tiledesk.com/articles/how-to-send-whatsapp-templates-via-tiledesk-webhook-and-hubspot-workflow/#add-a-webhook-action) <a href="#add-a-webhook-action" id="add-a-webhook-action"></a>

Click the plus icon below the enrollment trigger.

Select **Send a Webhook**.

Configuration:

Method: **POST**

URL: Paste the webhook URL you copied from Tiledesk Design Studio.

Authentication: **None**

Request body: Select **Choose properties to include**, and add:

**deal name = Deal name**

**userPhone = WhatsApp number** (make sure this matches your HubSpot contact property for WhatsApp numbers).

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

#### Test the Workflow[#](https://gethelp.tiledesk.com/articles/how-to-send-whatsapp-templates-via-tiledesk-webhook-and-hubspot-workflow/#test-the-workflow) <a href="#test-the-workflow" id="test-the-workflow"></a>

Move a test deal into the "Contract Sent" stage in your pipeline.

The webhook should trigger, sending the WhatsApp template through Tiledesk.

Once the message is sent, the chatbot configured in Tiledesk will automatically take over the conversation based on the knowledge base you have set up.

Check our video about this integration (don't forget to activate the English subtitles) [here](https://youtu.be/1frIJQROZSw).

{% embed url="<https://www.youtube.com/watch?v=1frIJQROZSw>" %}


---

# 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://guide.tiledesk.com/other-integrations/how-to-send-whatsapp-templates-via-tiledesk-webhook-and-hubspot-workflow.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.
