Data Connectors

In addition to the data supplied in your initial call to trigger a Workflow, you can enrich your Workflow with data from internal data connectors (orange) and external data connectors (blue). All data connectors let you use your Workflows fields in queries, to pull back relevant data for each execution.

Most Data Connectors will require setting up Credentials, using the Credentials page in the Sidebar. See Adding Datasource Credentials to set up a new one

For the examples below, we're using two dummy data sources, with credentials available here for you to try out: Sample Data Sources

πŸ“˜

You can now Save and Import Templates

Check out how to use Templates here

Database Connectors

You can query your internal company databases when your Workflow runs, to pull in additional info about the customers/transactions you're decisioning. Currently, Sliderule supports connections to:

  • Postgres Databases
  • MySQL Databases
  • Snowflake Databases (New)

To get started, add a new Internal Database logic block to your Workflow, and select the credentials you'd like to use from the Datasource dropdown. Once you've clicked into the block, you'll see a "Tables" helper on the bottom right, showing the tables and column schema to help you write a query.

You can create queries with matching logic to look up against fields that are part of the workflow (e.g. "how many times have I seen this device before?"). Sliderule supports Handlebars syntax, so just type {{ anywhere in your query, and you'll see the list of available fields from your workflow to insert at runtime.

You can see what your query would return by editing the Test Input and clicking the blue Test button. Each column returned by your query will be transformed into a field you can use in subsequent rules.

For example:

SELECT block_date, reason FROM blocked_ips WHERE ip = {{customer.ip_address}}

This query will return two fields you can use in your rules: block_date and reason. Once you're satisfied your query is returning the data you want, just click Save.

Note: if your query returns more than one row, only the first row will be parsed for fields.

API Connector

You can hit third-party APIs like fraud/identity data vendors for additional info to use in your rules. You can also use API Connector blocks to pull in data from your own internal services (e.g. feature stores).

Similar to the Database Connector above, drag out block onto your graph, and select the credentials you'd like to use from the Datasource dropdown. Once your block is saved, open it to configure the query.

Most data sources will use POST requests, and you can insert fields into the URL or Body by typing {{ and selecting fields from the dropdown. Try a request using the Test Input on the right, and when you're satisfied, click Save.

Spreadsheet Lookup

Spreadsheet Lookup blocks don't require credentials. Simply drag a block out onto the graph and give it a name, then upload a CSV you'd like to use as a lookup table. This should have field names as columns, for example

ipblockeddate
111.11.1111true1/1/2021
222.22.2222false1/1/2021

You'll then need to set your Match conditions. In the Field column, select the field from your Workflow you want to use as the lookup key. Then in the CSV Column dropdown, and pick the column from your spreadsheet you'd like to match against. You can add up to 5 match conditions.

Then try clicking the Test button to see if a matching row is returned. You'll be able to access any data fields in the matching row in future rules.

Using fields from Data Connectors in Rules

Regardless of which Data Connector you're using, you can use the fields returned by these sources in all subsequent Rules in your Workflow. You'll access these fields by using the shortname for the data source.

For example, if you named the API Connector block we added above risk_score_dat then try typing that into the IF box followed by a period, to see all the fields available for writing rules.

Handling Errors and Timeouts

Inside your Workflows, on any API Connector or Database Connector block, you can see an Error Path tab. Inside this tab, you can configure what happens if your API Call or Database Query returns an error, or takes too long to respond.

Timeouts can be configured in milliseconds, seconds, or minutes. After the limit is reached, the Action cell will run (just like if an error was returned. You can put any Then and Action Cells options in that action cell, including breakout rules to other paths in your workflow

You can also configure up to 3 retries with desired waiting times in between attempts, if you'd like your workflow to attempt to call this data source again upon error.