# Workflows for Kylas

### WhatsApp Messages from Kylas

You can send a template message as soon as a lead gets created in Kylas CRM.&#x20;

{% hint style="info" %}
You can send the Template message(s) that is/are verified by **META**.
{% endhint %}

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

<figure><img src="https://3137140735-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZcl3T6ePz95GpzjAeOLW%2Fuploads%2F1tChcPLs630OsAXXJPK0%2FKylas_CRM%201.png?alt=media&#x26;token=fad88384-ea89-4c35-b4d6-68ea62e627fd" alt=""><figcaption><p>Kylas Dashboard</p></figcaption></figure>

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

<figure><img src="https://3137140735-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZcl3T6ePz95GpzjAeOLW%2Fuploads%2F4fbI9t83BXgMpsEa2NGN%2FKylas_CRM%201.1.png?alt=media&#x26;token=756a6dd5-6aae-499b-97ee-6efefd63ef47" alt=""><figcaption><p>Automations in Kylas CRM Settings</p></figcaption></figure>

3. Click on Add a Workflow as shown in the picture below.&#x20;

<figure><img src="https://3137140735-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZcl3T6ePz95GpzjAeOLW%2Fuploads%2FX7azCMoGpgwfERAeyqp5%2FKylas_CRM%201.2.png?alt=media&#x26;token=75cdf651-445f-4128-8b06-13781ad63100" alt=""><figcaption><p>Add a Workflow</p></figcaption></figure>

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

<figure><img src="https://3137140735-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZcl3T6ePz95GpzjAeOLW%2Fuploads%2FzB7M0TS1e8eoYjUP8eGn%2FSend%20Message%201.1.png?alt=media&#x26;token=a77d394b-2b07-4497-ad63-29851abf4e3e" alt=""><figcaption><p>Naming the Workflow</p></figcaption></figure>

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.&#x20;

<figure><img src="https://3137140735-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZcl3T6ePz95GpzjAeOLW%2Fuploads%2Ff3BM9C8q3AfCCixUmBLi%2FKylas_CRM%201.4.png?alt=media&#x26;token=377e4112-b6c8-47a0-a9ea-358bcb574482" alt=""><figcaption><p>Selecting an Entity</p></figcaption></figure>

6. Next is selecting an action type and trigger preference to your workflow.&#x20;

<figure><img src="https://3137140735-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZcl3T6ePz95GpzjAeOLW%2Fuploads%2FoVtVjSq3mEA0LV057DCS%2FKylas_CRM%201.5.png?alt=media&#x26;token=4df5da4a-0c9f-47ca-84ae-a899d48ea5de" alt=""><figcaption><p>Selecting an Action Type</p></figcaption></figure>

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

<figure><img src="https://3137140735-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZcl3T6ePz95GpzjAeOLW%2Fuploads%2FicH113Qu31RX86WMyl8g%2FKylas_CRM%201.6.png?alt=media&#x26;token=0f6c3929-6410-4f7e-beea-f49012b1e8a8" alt=""><figcaption><p>Selecting the trigger</p></figcaption></figure>

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**.&#x20;

<figure><img src="https://3137140735-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZcl3T6ePz95GpzjAeOLW%2Fuploads%2Fjgxud5OGtWnlOgzqmcFN%2FKylas_CRM%201.7.png?alt=media&#x26;token=fefcf6cb-ffe2-43e5-bbdc-2c2f9f181f58" alt=""><figcaption><p>Setting the Condition and the action to be performed</p></figcaption></figure>

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

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.**

<figure><img src="https://3137140735-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZcl3T6ePz95GpzjAeOLW%2Fuploads%2FOZvwfJxsjvFa7P3KnDN3%2FSend%20Message%201.2.png?alt=media&#x26;token=ebb374c6-2e6b-4224-b760-5cab4cc52148" alt=""><figcaption><p>Editing the name , Request Type, and URL for Webhook</p></figcaption></figure>

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 (:).&#x20;

{% hint style="info" %}
Get the apikey and apisecret from your [Gallabox Account](https://docs.gallabox.com/~/changes/A8xmww5XU9i8x7QbfPLe/integration/customer-relationship-management-crm-systems/kylas/broken-reference).&#x20;
{% endhint %}

<figure><img src="https://3137140735-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZcl3T6ePz95GpzjAeOLW%2Fuploads%2FNBGAmjGJ9vQAyQTeDpWw%2FKylas_CRM%201.9.png?alt=media&#x26;token=a5eda39e-556f-46a7-b17a-95df186d8da9" alt=""><figcaption><p>Inserting the Key Name and Value</p></figcaption></figure>

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.&#x20;

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

{% hint style="info" %}
Copy paste the variables like **channelId or** t**emplateName** as they are without any change.
{% endhint %}

You can add the parameters like headerMediaUrl, headerMediaName, footerButtondomain, and footerButtonUrl depending on the message template you have created. Go to[Broken link](https://docs.gallabox.com/~/changes/A8xmww5XU9i8x7QbfPLe/integration/customer-relationship-management-crm-systems/kylas/broken-reference "mention")to get more idea on how to add the custom variables.&#x20;

<figure><img src="https://3137140735-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZcl3T6ePz95GpzjAeOLW%2Fuploads%2Fb0eMHTSRSSiE1li3VNE7%2Fkylas.png?alt=media&#x26;token=310e4ba2-b288-4aed-9bdb-36a2a56abf7e" alt=""><figcaption><p>Adding the Parameters</p></figcaption></figure>

12. Click on Save to Save the Webhook.&#x20;

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

<figure><img src="https://3137140735-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZcl3T6ePz95GpzjAeOLW%2Fuploads%2FtYrBgdy3cYeP8sOo8qOW%2FSend%20Message%201.4.png?alt=media&#x26;token=4900cbe7-25b2-4857-8ed8-e60279219da3" alt=""><figcaption><p>Saving the workflow</p></figcaption></figure>

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

### 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.&#x20;

Let's take a step-by-step approach to make this happen.&#x20;

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

<figure><img src="https://3137140735-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZcl3T6ePz95GpzjAeOLW%2Fuploads%2F1tChcPLs630OsAXXJPK0%2FKylas_CRM%201.png?alt=media&#x26;token=fad88384-ea89-4c35-b4d6-68ea62e627fd" alt=""><figcaption><p>Kylas Dashboard</p></figcaption></figure>

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

<figure><img src="https://3137140735-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZcl3T6ePz95GpzjAeOLW%2Fuploads%2F4fbI9t83BXgMpsEa2NGN%2FKylas_CRM%201.1.png?alt=media&#x26;token=756a6dd5-6aae-499b-97ee-6efefd63ef47" alt=""><figcaption><p>Automations in Kylas CRM Settings</p></figcaption></figure>

3. Click on Add a Workflow as shown in the picture below.&#x20;

<figure><img src="https://3137140735-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZcl3T6ePz95GpzjAeOLW%2Fuploads%2FX7azCMoGpgwfERAeyqp5%2FKylas_CRM%201.2.png?alt=media&#x26;token=75cdf651-445f-4128-8b06-13781ad63100" alt=""><figcaption><p>Add a Workflow</p></figcaption></figure>

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

<figure><img src="https://3137140735-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZcl3T6ePz95GpzjAeOLW%2Fuploads%2F3SLGV5VNS2w1niH02zDc%2FKylas_CRM%201.3.png?alt=media&#x26;token=9d633230-c12e-45c3-b598-27c4c573f3a9" alt=""><figcaption><p>Naming the Workflow</p></figcaption></figure>

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.&#x20;

<figure><img src="https://3137140735-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZcl3T6ePz95GpzjAeOLW%2Fuploads%2Ff3BM9C8q3AfCCixUmBLi%2FKylas_CRM%201.4.png?alt=media&#x26;token=377e4112-b6c8-47a0-a9ea-358bcb574482" alt=""><figcaption><p>Selecting an Entity</p></figcaption></figure>

6. Next is selecting an action type and trigger preference to your workflow.&#x20;

<figure><img src="https://3137140735-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZcl3T6ePz95GpzjAeOLW%2Fuploads%2FoVtVjSq3mEA0LV057DCS%2FKylas_CRM%201.5.png?alt=media&#x26;token=4df5da4a-0c9f-47ca-84ae-a899d48ea5de" alt=""><figcaption><p>Selecting an Action Type</p></figcaption></figure>

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

<figure><img src="https://3137140735-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZcl3T6ePz95GpzjAeOLW%2Fuploads%2FicH113Qu31RX86WMyl8g%2FKylas_CRM%201.6.png?alt=media&#x26;token=0f6c3929-6410-4f7e-beea-f49012b1e8a8" alt=""><figcaption><p>Selecting the trigger</p></figcaption></figure>

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**.&#x20;

<figure><img src="https://3137140735-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZcl3T6ePz95GpzjAeOLW%2Fuploads%2Fjgxud5OGtWnlOgzqmcFN%2FKylas_CRM%201.7.png?alt=media&#x26;token=fefcf6cb-ffe2-43e5-bbdc-2c2f9f181f58" alt=""><figcaption><p>Setting the Condition and the action to be performed</p></figcaption></figure>

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

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.**&#x20;

<figure><img src="https://3137140735-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZcl3T6ePz95GpzjAeOLW%2Fuploads%2FvC8HSqgd2wahaIGjOK8x%2FKylas_CRM%201.8.png?alt=media&#x26;token=7b21ec9a-1498-4124-a103-f31f477c5516" alt=""><figcaption><p>Editing the name , Request Type, and URL for Webhook</p></figcaption></figure>

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 (:).&#x20;

{% hint style="info" %}
Get the apikey and apisecret from your [Gallabox Account.](https://docs.gallabox.com/~/changes/A8xmww5XU9i8x7QbfPLe/integration/customer-relationship-management-crm-systems/kylas/broken-reference)
{% endhint %}

<figure><img src="https://3137140735-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZcl3T6ePz95GpzjAeOLW%2Fuploads%2FNBGAmjGJ9vQAyQTeDpWw%2FKylas_CRM%201.9.png?alt=media&#x26;token=a5eda39e-556f-46a7-b17a-95df186d8da9" alt=""><figcaption><p>Inserting the Key Name and Value</p></figcaption></figure>

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.&#x20;

{% hint style="info" %}
Copy paste the variables like **channelId or** t**emplateName** as they are without any change.
{% endhint %}

You can add the parameters like headerMediaUrl, headerMediaName, footerButtondomain, and footerButtonUrl depending on the message template you have created. Go to[Broken link](https://docs.gallabox.com/~/changes/A8xmww5XU9i8x7QbfPLe/integration/customer-relationship-management-crm-systems/kylas/broken-reference "mention")to get more idea on how to add the custom variables.&#x20;

<figure><img src="https://3137140735-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZcl3T6ePz95GpzjAeOLW%2Fuploads%2FwahwH2Y4H1DcfaEkGR1L%2FKylas_CRM%201.10.png?alt=media&#x26;token=5acb546e-d696-474a-ae50-dd278f79b085" alt=""><figcaption><p>Adding the Parameters</p></figcaption></figure>

12. Click on Save to Save the Webhook.&#x20;

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

<figure><img src="https://3137140735-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZcl3T6ePz95GpzjAeOLW%2Fuploads%2FRsPlXvdBhhbQQAjf19Ad%2FKylas_CRM%201.11.png?alt=media&#x26;token=f2b55d67-4479-48c1-8bae-c67697aef13f" alt=""><figcaption><p>Saving the workflow</p></figcaption></figure>

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