Automate Your Life / Work With CSML and Zapier, Integromat and IFTTT

Automation solutions are some of the most powerful tools that you can use in a chatbot to increase the productivity, efficiency and value of your chatbot. Let's have a look at how to leverage the power of Zapier, Integromat and IFTTT in your next chatbot!

Automate Your Life / Work With CSML and Zapier, Integromat and IFTTT

CSML Studio offers you many integrations with a wide range of products and services that you can very easily connect with your chatbot, in the form of chatbot Apps. Today, we're going to have a look at some of the most powerful and popular integrations of the lot: the Automation category, which includes developer favorites such as Zapier, Integromat and IFTTT apps.

Zapier

Zapier is probably the most used workflow automation tool. It is very popular, especially for marketing or sales teams that need to automate many tasks and connect many apps very easily, and it is quite easy to integrate in your chatbot with a custom webhook.

As an example, let's create a chatbot that will get data from a visitor and use a Zapier webhook to send the data as a new row in a Google Sheets spreadsheet. First, setup a workflow in Zapier just like this:

In the next screen, you can start configuring your webhook:

Zapier simply gives you the webhook you need to use, so copy the URL right away. In the next step, Zapier needs you to actually perform an example call to your webhook before you can continue:

So let's setup the integration on CSML Studio! In the Apps section, find and install the Zapier app. You don't need to add any specific configuration as zapier webhooks don't require any API key!

Then in CSML make an example call with dummy data. For example, let's say we are registering new leads in a spreadsheet, so we have their firstname, lastname and company. You can use the Test button with this sample data:

{
  "webhook": "MY_WEBHOOK_URL",
  "payload": {
    "firstname": "John",
    "lastname": "Doe",
    "company": "Google"
  }
}

Then, back on Zapier, after you click on Test Trigger, you should get a screen similar to this:

After you click on Continue, you can setup your Google Spreadsheet automation. Make sure you select "create spreadsheet row", then click on Continue again. Sign in to your Google account, selet the spreadsheet you want to interact with (make sure it has a first row with the headers you want!) and configure it by selecting which value from your webhook goes into which column in your spreadsheet:

Once that's done, you can test your action to check whether the correct info is correctly sent to the spreadsheet. Then, don't forget to turn on your Zap to use it in your CSML code!

Finally, here is how you can use the zapier integration in CSML:

do App(
    "zapier",
    webhook="MY_WEBHOOK",
    payload={"firstname": "John", "lastname": "Doe", "company": "Google"}
)

You can obviously dynamically retrieve the user's information; and sure enough, when this code runs, you will find all the info in you Google Sheets spreadsheet:

Integromat

Integromat is also a very popular option for workflow automation, which they call "scenarios". I personally find it a bit more complex to use than Zapier and IFTTT, but a lot of people use it and it has tons of integrations, so it is a very solid option. I understand it's also a bit cheaper than Zapier, which is probably also why it is quite successful!

For this example, let's say we are still trying to capture leads from our chatbot, but this time we want to receive an email everytime a new lead comes in.

As with Zapier, you will first need to configure Integromat by adding a Webhook trigger. The documentation on how to do that is available here: https://www.integromat.com/en/help/app/webhooks. I encourage you to read it thoroughly!

Once you are at the "Determine data structure" stage, we can go through the same process as with Zapier: first, setup the Integromat app in CSML Studio, and test it with a similar payload in the Test panel.

Once this is done, you should have something similar to this screen:

Then, create an email module that should send you an email when the webhook is triggered, with the following configuration:

Click OK and save the scenario. Also make sure that the scenario is "ON" before you start using it:

To use this in your CSML chatbot, you can copy the following code:

do App(
    "integromat",
    webhook="MY_WEBHOOK_URL",
    payload={"firstname": "John", "lastname": "Doe", "company": "Google"}
)

And a few seconds later, you receive this email:

IFTTT

IFTTT is also a cool workflow automation alternative, perhaps slightly more user-friendly as the other two. It is more geared as a personal automation solution, than a professional one, but some of the integrations are the same as Zapier or Integromat, so feel free to use whichever suits you best!

You will once again need to create a webhook trigger, but this time instead of having IFTTT create a random URL, you will decide what the name of the event should be and use that. In our case, we'll call our event CSML_event.

This time, let's say I want to integrate my CSML chatbot with my Philips Hue lights at home. I'll look for the Philips Hue integration and set it up to toggle all my lights:

To setup the IFTTT integration in CSML Studio, you will simlpy need your IFTTT API key (which you can find by clicking on the Documentation link on this page when you are logged in) and the name of the Webhook event.

Then, in your CSML code, you can use it as follows (we don't need any specific payload here, so we can leave it as an empty object):

do App("ifttt", event="CSML_event", payload={})

With this code, everytime I run my chatbot, my Hue lights toggle on/off!

Going Further

In these examples we mostly used 1 webhook -> 1 action types of workflows. But all of these tools allow you to spread your webhook's payload to several other tools. For example, how about:

  • Capture a lead
  • Save it on Google Sheets
  • Save it in your Hubspot CRM as a new lead
  • Send an email to the person who is in charge of new leads
  • Send an email to the lead to thank them for their interest

This will multiply the effects of your automation and make it even more powerful!

There is a TON of very valuable things you can do with workflow automation tools such as Zapier, Integromat or IFTTT. I encourage you to think about all the tedious, repetitive tasks you perform by hand every day and whether they could be easily automated with tools like these.

You can find some ideas for cool automations on lists such as this one. Obviously not all of these ideas are right for a chatbot, but it's still a good starting point!