> ## Documentation Index
> Fetch the complete documentation index at: https://docs-next.gallabox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Workflows for Kylas

> Send automated WhatsApp messages using Kylas CRM. Set up a workflow to send template messages when a lead is created. Follow our step-by-step guide in the CRM settings.

### WhatsApp Messages from Kylas

You can send a template message as soon as a lead gets created in Kylas CRM.

<Info>
  You can send the Template message(s) that is/are verified by **META**.
</Info>

1. Go to your Kylas CRM and navigate to CRM Settings at the bottom left of the navigation pane.

<Frame caption="Kylas Dashboard">
  <img src="https://mintcdn.com/gallabox/zLr1bn4U7TLbupvD/images/kylas-crm-1.png?fit=max&auto=format&n=zLr1bn4U7TLbupvD&q=85&s=7a8ab3e7e372fbb0044977f4c1fd0c6f" alt="Kylas Dashboard" width="1918" height="852" data-path="images/kylas-crm-1.png" />
</Frame>

2. In the CRM Settings, navigate to **Automations**. Under Automations, you will get the Workflow. Click on it.

<Frame caption="Automations in Kylas CRM Settings">
  <img src="https://mintcdn.com/gallabox/zLr1bn4U7TLbupvD/images/kylas-crm-1-1.png?fit=max&auto=format&n=zLr1bn4U7TLbupvD&q=85&s=458a1cd654e0f86feaa9da6b3b43748f" alt="Automations in Kylas CRM Settings" width="1915" height="853" data-path="images/kylas-crm-1-1.png" />
</Frame>

3. Click on Add a Workflow as shown in the picture below.

<Frame caption="Add a Workflow">
  <img src="https://mintcdn.com/gallabox/zLr1bn4U7TLbupvD/images/kylas-crm-1-2.png?fit=max&auto=format&n=zLr1bn4U7TLbupvD&q=85&s=e351a4aef4d920baa70259190d444898" alt="Add a Workflow" width="1917" height="852" data-path="images/kylas-crm-1-2.png" />
</Frame>

4. After clicking, it will ask you to Name your Workflow, and let's name it **sending\_message.**

<Frame caption="Naming the Workflow">
  <img src="https://mintcdn.com/gallabox/zlyXiaXI2I0eCp1u/images/send-message-1-1.png?fit=max&auto=format&n=zlyXiaXI2I0eCp1u&q=85&s=ea3eab8c9430110fc56ba21198d3b6af" alt="Naming the Workflow" width="1917" height="851" data-path="images/send-message-1-1.png" />
</Frame>

5. Choosing the Entity is the next step. Options available for Entity are Lead, Contact, Deal, Task, Call Log, and Meeting. Select from the options you would like to create an automated flow for. We will take Entity - Lead to create an automated flow as an example.

<Frame caption="Selecting an Entity">
  <img src="https://mintcdn.com/gallabox/zLr1bn4U7TLbupvD/images/kylas-crm-1-4.png?fit=max&auto=format&n=zLr1bn4U7TLbupvD&q=85&s=a5f493585a2856dae574c1884a4da92c" alt="Selecting an Entity" width="1917" height="847" data-path="images/kylas-crm-1-4.png" />
</Frame>

6. Next is selecting an action type and trigger preference to your workflow.

<Frame caption="Selecting an Action Type">
  <img src="https://mintcdn.com/gallabox/zLr1bn4U7TLbupvD/images/kylas-crm-1-5.png?fit=max&auto=format&n=zLr1bn4U7TLbupvD&q=85&s=684f637da448ffcdc85ff6d624d2b0f4" alt="Selecting an Action Type" width="1911" height="852" data-path="images/kylas-crm-1-5.png" />
</Frame>

7. We will take the action type as **When a Lead is Created** and the trigger as **Immediately**.

<Frame caption="Selecting the trigger">
  <img src="https://mintcdn.com/gallabox/zLr1bn4U7TLbupvD/images/kylas-crm-1-6.png?fit=max&auto=format&n=zLr1bn4U7TLbupvD&q=85&s=b99b39cf787e0cad4a304547aac0683e" alt="Selecting the trigger" width="1915" height="852" data-path="images/kylas-crm-1-6.png" />
</Frame>

8. Next is setting conditions and the action to be performed automatically. We will take the Condition as **All Leads**, and the action as **Webhook**.

<Frame caption="Setting the Condition and the action to be performed">
  <img src="https://mintcdn.com/gallabox/zLr1bn4U7TLbupvD/images/kylas-crm-1-7.png?fit=max&auto=format&n=zLr1bn4U7TLbupvD&q=85&s=fd5d5dfa2a0d999c5e9f11dcca200b49" alt="Setting the Condition and the action to be performed" width="1908" height="840" data-path="images/kylas-crm-1-7.png" />
</Frame>

9. A pop-up will appear to edit the webhook. Edit the name and if you would like to add the description, please add.

Select the Request type as **Post** and for the Request URL paste -

```
https://workflow.gallabox.com/webhook/messages/whatsapp/form
```

We have named the webhook as **sending\_message.**

<Frame caption="Editing the name , Request Type, and URL for Webhook">
  <img src="https://mintcdn.com/gallabox/zlyXiaXI2I0eCp1u/images/send-message-1-2.png?fit=max&auto=format&n=zlyXiaXI2I0eCp1u&q=85&s=faa29a879e62d36e5750d72528088d49" alt="Editing the name , Request Type, and URL for Webhook" width="1691" height="590" data-path="images/send-message-1-2.png" />
</Frame>

10. Select the authorization as **API Key**. In place of Key Name paste **apikeysecret** and for the value pass both apikey and apisecret separated with colon (:).

<Info>
  Get the [apikey and apisecret](https://github.com/mangoleaphq/gallabox-docs/tree/main/developer-resources/api-key-and-secret.md) from your Gallabox Account.
</Info>

<Frame caption="Inserting the Key Name and Value">
  <img src="https://mintcdn.com/gallabox/zLr1bn4U7TLbupvD/images/kylas-crm-1-9.png?fit=max&auto=format&n=zLr1bn4U7TLbupvD&q=85&s=b17072fde2fda3865ae7108f9cca6f6d" alt="Inserting the Key Name and Value" width="1613" height="549" data-path="images/kylas-crm-1-9.png" />
</Frame>

11. The last Step in editing the webhook is to add the parameters that you would like to push for the sending the automatic message when a lead is created in Kylas CRM.

We have added **channelId**, t**emplateName**, r**ecipientName**, r**ecipientPhones**, and **Name** (***Variable Name defined in the Message template***).

<Info>
  Copy paste the variables like **channelId or** t**emplateName** as they are without any change.
</Info>

You can add the parameters like headerMediaUrl, headerMediaName, footerButtondomain, and footerButtonUrl depending on the message template you have created.

<Frame caption="Adding the Parameters">
  <img src="https://mintcdn.com/gallabox/zLr1bn4U7TLbupvD/images/kylas.png?fit=max&auto=format&n=zLr1bn4U7TLbupvD&q=85&s=69142c5c589f1b020b6e71de1acfde57" alt="Adding the Parameters" width="476" height="268" data-path="images/kylas.png" />
</Frame>

12. Click on Save to Save the Webhook.

The pop-up will close and you will be redirected to the workflow window and you have to click on Save again.

<Frame caption="Saving the workflow">
  <img src="https://mintcdn.com/gallabox/zlyXiaXI2I0eCp1u/images/send-message-1-4.png?fit=max&auto=format&n=zlyXiaXI2I0eCp1u&q=85&s=61f96f7abdeb5931d183133e270cc57b" alt="Saving the workflow" width="1662" height="429" data-path="images/send-message-1-4.png" />
</Frame>

The automation is complete and wherever a lead is created in Kylas CRM, an automatic message will be shared with them over WhatsApp.

### Move Contacts

You can push the Contact details from Kylas to Gallabox as soon as the lead gets created or when the lead is updated.

Let's take a step-by-step approach to make this happen.

1. Go to your Kylas CRM and navigate to CRM Settings at the bottom left of the navigation pane.

<Frame caption="Kylas Dashboard">
  <img src="https://mintcdn.com/gallabox/zLr1bn4U7TLbupvD/images/kylas-crm-1.png?fit=max&auto=format&n=zLr1bn4U7TLbupvD&q=85&s=7a8ab3e7e372fbb0044977f4c1fd0c6f" alt="Kylas Dashboard" width="1918" height="852" data-path="images/kylas-crm-1.png" />
</Frame>

2. In the CRM Settings, navigate to **Automations**. Under Automations, you will get the Workflow. Click on it.

<Frame caption="Automations in Kylas CRM Settings">
  <img src="https://mintcdn.com/gallabox/zLr1bn4U7TLbupvD/images/kylas-crm-1-1.png?fit=max&auto=format&n=zLr1bn4U7TLbupvD&q=85&s=458a1cd654e0f86feaa9da6b3b43748f" alt="Automations in Kylas CRM Settings" width="1915" height="853" data-path="images/kylas-crm-1-1.png" />
</Frame>

3. Click on Add a Workflow as shown in the picture below.

<Frame caption="Add a Workflow">
  <img src="https://mintcdn.com/gallabox/zLr1bn4U7TLbupvD/images/kylas-crm-1-2.png?fit=max&auto=format&n=zLr1bn4U7TLbupvD&q=85&s=e351a4aef4d920baa70259190d444898" alt="Add a Workflow" width="1917" height="852" data-path="images/kylas-crm-1-2.png" />
</Frame>

4. After clicking, it will ask you to Name your Workflow, and we have named it **upsert\_contacts** for example.

<Frame caption="Naming the Workflow">
  <img src="https://mintcdn.com/gallabox/zLr1bn4U7TLbupvD/images/kylas-crm-1-3.png?fit=max&auto=format&n=zLr1bn4U7TLbupvD&q=85&s=045c561b138fe259822f1c6af0f8968c" alt="Naming the Workflow" width="1915" height="853" data-path="images/kylas-crm-1-3.png" />
</Frame>

5. Selecting Entity is the next step. Options available for Entity are Lead, Contact, Deal, Task, Call Log, and Meeting. Select from the options you would like to create an automated flow for. We will take Entity - Lead to create an automated flow as an example.

<Frame caption="Selecting an Entity">
  <img src="https://mintcdn.com/gallabox/zLr1bn4U7TLbupvD/images/kylas-crm-1-4.png?fit=max&auto=format&n=zLr1bn4U7TLbupvD&q=85&s=a5f493585a2856dae574c1884a4da92c" alt="Selecting an Entity" width="1917" height="847" data-path="images/kylas-crm-1-4.png" />
</Frame>

6. Next is selecting an action type and trigger preference to your workflow.

<Frame caption="Selecting an Action Type">
  <img src="https://mintcdn.com/gallabox/zLr1bn4U7TLbupvD/images/kylas-crm-1-5.png?fit=max&auto=format&n=zLr1bn4U7TLbupvD&q=85&s=684f637da448ffcdc85ff6d624d2b0f4" alt="Selecting an Action Type" width="1911" height="852" data-path="images/kylas-crm-1-5.png" />
</Frame>

7. We will take the action type as **When a Lead is Created** and the trigger as **Immediately**.

<Frame caption="Selecting the trigger">
  <img src="https://mintcdn.com/gallabox/zLr1bn4U7TLbupvD/images/kylas-crm-1-6.png?fit=max&auto=format&n=zLr1bn4U7TLbupvD&q=85&s=b99b39cf787e0cad4a304547aac0683e" alt="Selecting the trigger" width="1915" height="852" data-path="images/kylas-crm-1-6.png" />
</Frame>

8. Next is setting conditions and the action to be performed automatically. We will take the Condition as **All Leads**, and the action as **Webhook**.

<Frame caption="Setting the Condition and the action to be performed">
  <img src="https://mintcdn.com/gallabox/zLr1bn4U7TLbupvD/images/kylas-crm-1-7.png?fit=max&auto=format&n=zLr1bn4U7TLbupvD&q=85&s=fd5d5dfa2a0d999c5e9f11dcca200b49" alt="Setting the Condition and the action to be performed" width="1908" height="840" data-path="images/kylas-crm-1-7.png" />
</Frame>

9. A pop-up will appear to edit the webhook. Edit the name and if you would like to add the description, please add.

Select the Request type as **Post** and for the Request URL paste -

```
https://workflow.gallabox.com/webhook/contacts/upsert/form
```

We have named the webhook as **upsert\_contacts.**

<Frame caption="Editing the name , Request Type, and URL for Webhook">
  <img src="https://mintcdn.com/gallabox/zLr1bn4U7TLbupvD/images/kylas-crm-1-8.png?fit=max&auto=format&n=zLr1bn4U7TLbupvD&q=85&s=218e3e790b0e5f64ac37f6209cc98b02" alt="Editing the name , Request Type, and URL for Webhook" width="1697" height="587" data-path="images/kylas-crm-1-8.png" />
</Frame>

10. Select the authorization as **API Key**. In place of Key Name paste **apikeysecret** and for the value pass both apikey and apisecret separated with colon (:).

<Info>
  Get the [apikey and apisecret](https://github.com/mangoleaphq/gallabox-docs/tree/main/developer-resources/api-key-and-secret.md) from your Gallabox Account.
</Info>

<Frame caption="Inserting the Key Name and Value">
  <img src="https://mintcdn.com/gallabox/zLr1bn4U7TLbupvD/images/kylas-crm-1-9.png?fit=max&auto=format&n=zLr1bn4U7TLbupvD&q=85&s=b17072fde2fda3865ae7108f9cca6f6d" alt="Inserting the Key Name and Value" width="1613" height="549" data-path="images/kylas-crm-1-9.png" />
</Frame>

11. The last Step in editing the webhook is to add the parameters that you would like to push for the lead in Gallabox. We have added Name, **Email**, **Phone**, and **ContactownerId**. You can add the parameters like tags or any field value.

<Info>
  Copy paste the variables like **channelId or** t**emplateName** as they are without any change.
</Info>

You can add the parameters like headerMediaUrl, headerMediaName, footerButtondomain, and footerButtonUrl depending on the message template you have created.

12. Click on Save to Save the Webhook.

The pop-up will close and you will be redirected to the workflow window and you have to click on Save again.

<Frame caption="Saving the workflow">
  <img src="https://mintcdn.com/gallabox/zLr1bn4U7TLbupvD/images/kylas-crm-1-11.png?fit=max&auto=format&n=zLr1bn4U7TLbupvD&q=85&s=120330c43fc3073ef1377c404f29658b" alt="Saving the workflow" width="1608" height="640" data-path="images/kylas-crm-1-11.png" />
</Frame>

The automation is complete and wherever a lead is created in Kylas CRM, it will be pushed to Gallabox.
