Standard workflows in Modern Logic return an outcome (
Approve,Reject,Investigate). For many usecases, however, you might want to return additional information as part of your decision.
For our example, let's picture a fintech company that wants to offer a line of credit to its customers during onboarding. Their onboarding workflow will need to evaluate the relative riskiness of each customer, which will be stored as risk_score. The workflow will also need to return a custom variable, which we'll call dollar_limit
Let's create a new workflow, following the steps here: Creating a new Workflow
**API Connector** to the Graph using the built-in dummy "Credit Bureau" datasource, and a Ruleset after the datasource called "Basic Checks". Now save your updated Graph.
<aside> ⚠️ This assumes you're on the sandbox, with the standard "dummy data" sources built in. If you're in a different environment, your datasource options may look different.
In your "Basic Checks" Ruleset, create a new Rule and select Decision Table as the rule type. We're going to assign a new variable called risk_score for different potential values of our customer's FICO score.
Since this is a credit type workflow, we'll choose to make a higher risk score better, but you can configure custom variables however you like
Start typing "Credit" in the Field for this Column, and select
fico_score from autocomplete. We can add new rows to the table with the (+) button. Add 4 rows, and type in 4 conditions. See the example above.
Now you can add a custom risk_score to your actions field. We can add additional rules that adjust this risk_score later on. For example, if we have a variable tracking whether our customers have linked a bank account using Plaid, then we could write a rule to increase the risk_score for these customers (remember, we chose higher=better).
Next, save and deploy your workflow: Saving and deploying Workflows
Let's run some test customers through the workflow, either using Postman to hit the API, or the Test button explained here.
We can then see the scores generated for these customers in the History tab. Pick your test customer, and look at the Results field to see the risk_score for this customer