Overview: Webhook workflow module (Edify Console)

Edify Console > Workflows > Workflow modules > Overview: Webhook workflow module (Edify Console)

This article provides an overview of the webhook module in workflows in Edify Console.

In this article

Overview

The webhook module is a tool used for running an API request within a workflow. 

You can use the webhook module to run an API request against any REST or SOAP API (including the Edify API). 

Note: The webhook module is used for integrating with systems other than Salesforce. See our resources on integrating with Salesforce to learn how to integrate with Salesforce.

Some use cases of the webhook module include:

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.

Visual breakdown

Exterior structure

This is the exterior structure of a Webhook module. All modules share this same structure.  

Reference the Overview: Workflow modules article to take a deeper dive into each of these components.

Interior structure

Below is the deep dive explanation for each interior area of the Webhook module. 

Note: When configuring this module, you’ll most likely use variables. For more information on data types and value options, refer to the variable replacement overview article. 

View of the configuration menu of the Webhook module. 

Continue reading to learn about each of the sections in the module.

Data section

Data section (POST, PATCH, PUT)

There are additional fields in the Data section for HTTP methods that can have a request body.

Please refer to the API documentation of the API you want to use to learn what data format is most appropriate.

Advanced section

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:

For example, you could have a JSON response body that includes an array of user objects.

{

   "users": [

       {

               "userId": 1,

               "id": 1,

               "title": "delectus aut autem",

               "completed": false

       },

       {

               "userId": 2,

               "id": 2,

               "title": "delectus aut autem",

               "completed": false

       }

   ]

}

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:

users.0.title

This notation would target the `title` field in the first item in the `users` array.

There are several options in this menu: