Building a Chatbot using Zapier and Volt

In this tutorial, you'll learn how to build an automated SMS chatbot by connecting Zapier's automation platform with Volt's GraphQL API. We'll create a workflow that receives incoming messages, processes them using customizable logic, and sends responses through Volt's GraphQL API. This integration enables you to deploy a functional chatbot without managing server infrastructure.

 

image-20241220-213437.png
An example Zap workflow built using this guide

 Instructions

For this guide, we’re going to build a simple Zapier workflow that receives inbound messages, checks for certain words within those messages, and responds to a contact.

  1. Create a new Zap workflow in Zapier.

  2. In Step 1 of the Zap, select Webhooks by Zapier as the app.

  3. In the configuration for Step 1, choose the Catch Hook trigger event. Click Continue.

    image-20241220-213556.png
  4. In the Pick off a Child Key textbox, input payload. This will select the payload object from messaging webhooks from Volt. Click Continue.

  5. Copy your Zapier webhook URL. This will be used in the next steps as the webhook URL for messaging webhooks from Volt.

     

  6. Navigate to the webhook settings in Volt. If prompted, create an access token for the GraphQL API (this will not be required if you have already generated an access token previously).

  7. Click the Register Webhook button, then paste your Zapier webhook URL into the input field labeled Webhook URL.

     

Note: The webhook will fail to register successfully, and an error message will be shown, if the webhook URL is not pasted in exactly as it’s copied from Zapier. When registering a webhook URL, Volt sends a sample webhook request to validate that the URL is available and responding correctly.

  1. In Zapier, choose the sample webhook sent by Volt and continue to the next step.

  2. Add a new step in Zapier, choosing Paths as the app.

  3. In each Path, choose the conditions appropriate for your use case. For this example, we have created a path which is only chosen if the Text field from Step 1 contains the word available. Configure as many paths as is appropriate to respond to messages as is appropriate for your use case.

  4. Add a new step following the Path step. To send a message using Volt’s GraphQL API, choose the Webhooks by Zapier app, and select Custom Request as the action event. Select Continue.

  5. Enter the following values in the configuration section.

    Method
    POST

    URL
    https://api.respondflow.com/graphql

    Data Pass-Through?
    False

    Unflatten
    No

    Basic Auth
    (leave blank)

    Headers
    Content-Type: application/json
    Authorization: Bearer <Volt API access token>



    Data
    Copy the following GraphQL query exactly and paste it into the textbox. Replace {{CONTACT PHONE}}, {{VOLT PHONE}}, and {{MESSAGE TEXT}} with the appropriate values for your use case. For example, to send the message “Thank you” as a response to the phone number which sent the inbound message, replace {{CONTACT PHONE}} with the From Number field from Step 1, replace {{VOLT PHONE}} with the To Number field from Step 1, and replace {{MESSAGE TEXT}} with Thank you.

    {"query":"mutation createMessage ($to: String!, $from: String!, $body: String!, $media: [String!]) {\n createMessage (to: $to, from: $from, body: $body, media: $media) {\n id\n legacyId\n toNumber\n fromNumber\n status\n statusDescription\n media\n body\n sentAt\n confirmedAt\n }\n}","variables":{"to":"{{CONTACT PHONE}}","from":"{{VOLT PHONE}}","body":"{{MESSAGE TEXT}}","media":[]}}

     

  6. Choose Continue and repeat the previous steps as many times as needed to support your use case.

 

By following this tutorial, you've created a basic SMS chatbot that can engage with users through automated text messages. The combination of Zapier's automation tools and Volt's messaging infrastructure provides a solid foundation for building more complex conversational experiences.

 

 Related articles