Skip to main content

Using APIs in Workflows

A saved API can also be called from a workflow, without a CRM module. The workflow action is named Execute API Request, and it belongs to the Integrations group of actions. In the example, a workflow could look up a customer in PolicyHub KYC whenever a new lead is created. How workflows are built is covered in the Automations documentation. See Workflow Builder. This page covers only the Execute API Request action.

Adding the Action​

  1. Open the workflow in Configuration → Automation.
  2. Add an Action node and open its editor. The Edit action Node panel opens with a list of actions and a search box.
  3. Search for API and choose Execute API Request. Its description reads Execute a saved API request from a collection.
  4. Choose the collection under Select Collection.
  5. Choose the API under Select Request. Each variable of the API appears as an input. For Get Customer, an input named customerId appears.
  6. Fill in the variables and the optional settings, then click Save.

Edit action Node panel for Execute API Request showing the collection PolicyHub KYC, the request Get Customer, a customerId input, Request Overrides, and a timeout of 30000 milliseconds

Figure 1. The Execute API Request action configured with the PolicyHub KYC collection and the Get Customer request. The customerId input comes from the API's variable.

Settings​

SettingPurpose
Select CollectionThe collection that holds the API.
Select RequestThe saved API to run.
Variable inputsOne input for each variable of the API. They can take a value from an earlier step of the workflow. See Variables.
Request OverridesOptional changes to the URL, headers, parameters or body for this call only.
Timeout (ms)How long to wait for the outside system, in milliseconds. The default is 30000.
info

The result of the call is available to the steps that follow, so a Condition or an Update action can use the data that came back.

tip

Set a shorter timeout for lookups that should not hold up the workflow, and add a Condition after the action to handle a failed call.