Overview: Webhook workflow module (Edify Console)
This article provides an overview of the webhook module in workflows in Edify Console.
In this article
The webhook module is a tool used for running an API request within a workflow.
Some use cases of the webhook module include:
Getting information about an interaction from Edify API
Writing or updating information in a third-party platform
Providing a way for users to access information from a third-party platform (in coordination with the Say + Gather module)
You can configure the webhook module to save a portion of the API response body as one or more variables. This is useful when you want to pull information from an external system for use within the workflow.
Alternatively, you can set a variable if the API request should fail. This means you can have branching possibilities based on the success or failure of an API request.
The webhook module is highly configurable, meaning there are virtually endless possibilities for integrating Edify with a third-party API.
How it works
Here is a simple use case for implementing a Webhook module in your workflow:
You run a retail business where, in an attempt to draw in more sales, you want to send new subscribers to your newsletter a discount code for their first purchase.
You manage your subscribers from a database attached to your website’s URL and use Edify to manage inbound interactions to handle the more routine customer inquiries like payment, tracking, etc.
You decide to set up a workflow to grow your customer base and expand your newsletter audience:
You start with a Say + Gather module to collect some of the customer’s contact information. Once you’ve collected the customer’s data, you want to know if the person is subscribed to your newsletter. So, you use a webhook module to read your database, using the customer information to look up their records.
If there’s a match, the workflow goes down the Success route, and the workflow can proceed with helping the customer with their issue. If there isn’t a match because the system wasn’t able to locate a record with the same customer information (if the customer isn’t a subscriber), the Failure route can link to a Say - Intent module to ask if they’d like to become a subscriber. If the customer agrees to become a subscriber, you use another webhook module to write the customer’s information to the database.
After writing the information to the database, you can send the customer an email with the Send Email module containing a discount code.
This is just one example of how you could use the webhook module in a workflow to read, write, or update data on an external database.
Below is the deep dive explanation for each interior area of the Webhook module.
View of the configuration menu of the Webhook module.
Continue reading to learn about each of the sections in the module.
Data section (POST, PATCH, PUT)
There are additional fields in the Data section for HTTP methods that can have a request body.
Set Variables section
The Set Variables section is where you map values in the response body to variables that the workflow can use in later modules. You can map values either to pre-configured Edify variables or custom variables that you create.
There are three main fields in this section:
Name: The Name field identifies the property of the response body you want to use.
For example, you could have a JSON response body that includes an array of user objects.
If you wanted to target the ‘title’ value of the first item in the list, you would set the Name value to the following dot notation:
This notation would target the `title` field in the first item in the `users` array.