The Execute Workflow endpoint, described in the API Reference below, is the most important part of Sliderule. This endpoint is how you connect your product to Sliderule, to Execute the logic Workflows you've built, and consume responses.

Each workflow has its own dedicated URL, which stays constant as you deploy new versions of the workflow.

This Getting Started guide explains how to hit this Endpoint in a little more detail, since this is often the first place you'll start with Sliderule.

Grab an active token

First, you'll need a Token (see Authorizing your client above). Next you'll need a few other pieces

Find your Workflow URL

Next, you'll need the URL for the Workflow you'd like to hit.

Click on the Workflows page in Sliderule, and select the Workflow you'd like to hit. Click on the green Input block, which is always the first node on the graph. Below the title on the detail panel, you should see the URL for this workflow, (ending in /execute). Copy this URL.

1251

Note: have you deployed your Workflow recently? Remember to click Deploy on the latest version of your workflow before testing.

Create your JSON Request Body

For your Workflow to do much, you'll need to pass it input fields. Each Workflow has customizable Input fields can be customized per workflow.

To get started, open a Workflow and click Test > Individual - you'll see an example of a recent request, including all its fields, on the left hand side of the panel.

2384

Calling a workflow with CURL

With these three elements, you can set up an API request to Modern Logic. We have a sample for you below

curl -X POST https://api-sandbox2.usemodernlogic.com/v1/workflow/225/execute\
 -H "Accept: application/json"\
 -H "Authorization: Bearer <token>"\
 -H "Content-Type: application/json"\
 -d '{"amount": 627.62, "ip_address": "11.111.1111", "source_currency": "USD", "destination_currency": "BTC","device_id": "abc123"}'

Calling a workflow with Postman

Once you have the URL, Token, and Request body described above, calling your workflows from Postman is a cinch!

Create a new Collection
From Postman, let's create a new collection, and set up authentication for Bearer Tokens. Copy in your Token. Don't forget to click Save, or your newly added Token will be left out of your API Requests

Postman Collection

Create a new Request
In your new Collection with Authentication already configured create a new POST request. Paste the URL for your workflow, make sure Authorization is inheriting the bearer token properly, and Body is set to Raw > JSON

Postman Request

Next let's put some sample data in the body of the request. Just copy your JSON request body into the the body of the request in Postman and click Send. Here's a sample request body below in case helpful

{
    "age": 47,
    "dob": "1992-05-09",
    "ssn": "509-50-2965",
    "city": "South Lake Tahoe",
    "name": "Crawford Roscrigg",
    "email": "[email protected]",
    "phone": "301-555-5555",
    "state": "CA",
    "address1": "9905 Killdeer Street",
    "lastName": "Shank",
    "firstName": "Nicholas",
    "income_source": "wages",
    "customerId": "12345G",
    "time_to_complete_form": 17
}