Create a decision flow
How to build a decision engine flow.
LoanPro's Decision Engine is a powerful, customizable tool that allows lenders to seamlessly provide decision logic to their underwriting and origination processes. In this article, we explain how to create your own decision flows—a visualized sequence of logic that provides decision outputs.
Decision Flow basics
Before building a Decision Flow, let's cover the basics of how Flows work. In simple terms, Flows function work like this:
- You build Flow logic via connected nodes
- Data moves through the Flow nodes as an Input
- A result is returned at the end of a Flow as an Output
In a Decision Flow, you define the logic by which you process input data. You implement the decision logic with nodes where each node can contain a separate piece of the entire decision logic. The goal of a single node is to process a data sample and result in a decision or a result from the processing.
For example, a node can separate customers by their age and decide that people younger than 18, are rejected from the flow and the rest are accepted to move further in the Decision Flow logic.
You build the decision logic further by creating a flow of nodes. After a node at the beginning of the flow processes a sample of data, it results in a decision or a result from the processed data. In the next node in the flow, you can use the decision or processed data from the previous node to make another decision that then passes down the next node in the flow.
We cover nodes in much more detail in our node types and operators article.
The Decision Flow starts with an Input node and ends with an Output node. When you feed the Input node or send programmatic requests through the API to the Decision Flow, a single sample (or record of data) passes through the Decision Flow node by node and the data in the sample is evaluated based on the logic in each node. Depending on the result, the data from the sample is passed onto the next node for further processing.
Common use cases for Decision Flows
You can use Decision Flows to make data-driven decisions. Common use cases of Decision Flows include:
- Safely approving users for credit lines or loans
- Flagging users that are at-risk based on health data
- Identifying fraudsters
Create a Decision Flow
With the basics down, let's create a sample Decision Flow. In this example, you will be creating a simple credit policy Decision Flow that determines if a customer is approved for a line of credit account and calculates a credit limit. This process includes the following steps:
- Initiate a Decision Flow
- Upload test data
- Configure an input schema
- Implement decision logic with nodes
- Configure an output schema
- Test the Decision Flow
- Publish the Decision Flow
Initiate a Decision Flow
Begin by logging in to LoanPro's Decision Flow platform. Next, use the following steps to initiate a Decision Flow:
- Click the Create Decision Flow button.
- Enter details for the new decision flow:
- For Name, type the name of the new Decision Flow.
- For URL Identifier, type a URL identifier that you can use to send calls to this Decision Flow via API or Automated Notifications.
- (Optional) Type a description.
- Click Create.
- Click on the newly created Decision Flow pane to open the Decision Flow and then select the initial draft version v1.0. This leads you to the authoring canvas where you can start developing a Decision Flow itself.

Upload test data
Test datasets are used to test the outcomes of a Decision Flow. We recommend starting your Decision Flow build by creating a test dataset because input data will dictate the overall design of the Flow.
The test dataset you provide can be built manually within the Decision Engine or via a CSV, XLSX, or JSON file. In this example, we'll use a CSV file to upload a dataset of users with mock data. This dataset includes 7 users with the following attributes:
| customer_id | age | repeat_customer | credit_score | past_due_amount |
| 1 | 35 | TRUE | 787 | 0 |
| 2 | 55 | FALSE | 890 | 0 |
| 3 | 17 | FALSE | 765 | 0 |
| 4 | 34 | TRUE | 830 | 0 |
| 5 | 16 | FALSE | 799 | 0 |
| 6 | 34 | TRUE | 500 | 3500 |
| 7 | 34 | FALSE | 735 | 0 |
💾 Download this dataset as a CSV file
To upload test data to your Flow, complete the following steps:
- Click Test Data from the left sidebar. Here, you can upload multiple datasets to your Decision Flow.
- Click Create test dataset and select Upload file. This will open a file upload modal where you can provide a file.
Once the data file is validated, the dataset and its contents will be displayed:

Next, we'll implement an Input Schema that matches the structure of the test data and also serves as a schema for future production data.
Configure an Input Schema
The Input Schema defines the structure and format of incoming production data required for processing within a Decision Flow. It specifies the necessary fields and their respective data types to ensure compatibility with the Decision Flow's logic. Additionally, test data must conform to the Input Schema, as it is used to validate the Decision Flow's performance.

Within the Input Schema, each data field can be configured with various attributes, including:
- Required vs. Optional – Specifies whether a field is mandatory or can be omitted.
- Nullable vs. Non-nullable – Determines whether a field can contain null values.
- Do not store in Decision History – Allows flagging a field to be excluded from Decision History (useful for fields containing personally identifiable information (PII), preventing them from being stored during backtesting and exports).
- Data Type – Defines the expected type of data for the field (e.g., string, integer, boolean).
To create an Input Schema, complete the following steps:
- Open the Schema panel from the left sidebar.
- Add new Input Fields.
- Navigate to the Input Fields tab.
- Click Add Field and define the following five fields based on the test data:
- customer_id : integer
- age : integer
- repeat_customer : boolean
- credit_score : integer
- past_due_amount : integer
- Configure Field Properties.
- For each field, click the cog icon and set the following attributes:
- Required: enabled
- Nullable: disabled (fields must not accept null values)
- Do not store in Decision History toggle: disabled (fields can be stored in the Decision History).
- For each field, click the cog icon and set the following attributes:
- Validate the schema.
- Click Test in the upper-right corner to verify that the schema matches the uploaded sample test data. (Since only one dataset is available, the correct test dataset is automatically selected.)
After a few seconds, a successful output panel should appear, confirming that the schema validation passed.

If you receive an error, double-check that your schema includes all of the fields correctly. Field names are case-sensitive.
Next, we'll add nodes to provide the Decision Engine's logic.
Implement decision logic with nodes
To implement decision logic, you add nodes to the Decision Flow. Nodes are configurable, and there are several types available that you can use to implement different types of logic.
All nodes use the data object which can be used to access all fields from your input schema as well as any calculated fields from upstream nodes. For example, when you configure a node, to refer to a field from your input data with the name customer, you refer to the field with data.customer.
You can also use the data object to create new fields. This means that the field does not need to exist in your input data. For example, when you define a new field in a node, such as data.decision, you can use this new field to create logic around it. When you do a Test Run, any logic that you create for this field will be recorded as a new column in the data resulting from the Test Run. You can view this in the Inspect Data tab which is available for all nodes.
Within a Test Run, each sample in the test data is run individually through the Decision Flow so the data object only has access to the data fields of one sample at a time.
For more information on nodes, see Node types and operators.
Use a Rule node to knock out applicants by minimum age
For our example Flow, let's say we'd like to knock out any applicant that is younger than a specified age. You can use a Rule Node to create logic that excludes customers below the age of 18 from being processed further in the Decision Flow.
Complete the following steps to add this logic to the Flow:
- Within the Decision Flow, hover over the connecting arrow between the Input and Output nodes and click the plus icon. This will open the Add a node panel on the right side.
- Select the Rule Node.
- Configure the Rule Node to exclude customers below 18 years of age from the Decision Flow.
- To edit the title, hover over Untitled Node, click, and then type Reject customer based on age.
- For Add or modify these fields, define the field you want to modify with the Rule Node. In this case, you modify the decision field. Next to data., enter decision.
- Click Add rule.
- Define the logic for the new rule as follows: If data.age is less than 18, set the value of data.decision to "REJECTED" (in quotes).
- Under Default values, define a default value for data.age when the rule above evaluates to False (or for customers aged 18 and above). Set the Default value of data.decision, to "ACCEPTED" (enclosed in quotes).
- Click Test to test the results of the newly added node.
- In the Rule Node panel on the right, select the Inspect data tab to view the results from the test.

In the Inspect data tab, scroll to the right. At the rightmost column, you can see the new decision field. The decision field contains the value of "REJECTED" for customers under the age of 18 as expected.
Use a Split Node, Rule Node, and Decision Table to calculate credit limit
For the next portion of the Decision Flow, let's configure a few nodes that will work together to calculate the applicant's suggested credit limit. Complete the steps below to complete this process.
Create Split Nodes
Create a Split Node to create an “early exit” for rejected customers by completing the following steps:
- Hover over the arrow below the Rule Node and click the + sign to create a new node.
- Select Split Node.
- Set the node title to Is customer rejected?.
- Under Branch 1, define the decision route for customers who are rejected. If data.decision equals “REJECTED” (in quotes), set Use branch to Yes, Customer rejected.
- Under Default branch, define the route for accepted customers. Set Use branch to No, Continue.
Create another Split Node to separate new from existing customers because the Decision Flow needs to use different logic to calculate a credit limit depending on the customer's tenure.

- Hover over the No, continue split branch and click the + icon.
- Select Split Node
- Set the node title to New vs Existing?.
- Under Branch 1, define the logic for when a customer is not a returning customer. If data.repeat_customer equals False, set Use branch to New customer.
Create a Rule Node
Next, create a Rule Node to define a credit limit for new customers. Complete the following steps:
- Hover over the line under the New customer split branch, and click the + icon.
- Select Rule Node.
- Set the node title to Set limit.
- For Add or modify these fields, set data.limit.
- Under Rule 1, define a condition that sets data.limit to 15000 if a customer's credit score is 800 or higher. If data.credit_score is >= 800, set the value of data.limit to 15000.
- Click Add rule and under Rule 2, define a condition that sets data.limit to 10000 if a customer's credit score is 750 or higher. If data.credit_score is >= 750, set the value of data.limit to 10000.
- Under Default Values, set Default value of data.limit to 0.

Create a Decision Table Node
Lastly, create a Decision Table Node to define a limit for existing customers.
- Hover over the line under the Existing customer split branch, and click the + icon.
- Select Decision Table Node.
- Set the node title to Set limit.
- Under the Conditions column, set the first row to data.credit_score.
- Under the Results column, set the first row to data.limit.
- Add an additional row to the Decision Table
- Hover over row 1.
- Click on the menu icon.
- Select Insert Case Below.
- For the second row, use the Greater than or equals operator >= with a value of 800 for Conditions and set Results to 20000.
- For the third row, use the Greater than or equals operator >= with a value of 750 for Conditions and set Results to 15000.
- Set the last row is any to 0.

Use a Code Node & Flow Parameters to cap the credit limit
To cap the credit limit based on the past_due_amount, you can use either a Rule Node or a Code Node. In this tutorial, we will use a Code Node. This method also uses Parameters, which are sets of customizable thresholds for data points within the Flow.
Complete the following steps to add this logic to the Flow:
- Define a new flow parameter params.limit_multiplier on the Decision Flow version level.
- Select Parameters from the sidebar on the left.
- Click Add parameter.
- In the Add parameter window, define the parameter. Define Name as params.limit_multiplier and set the Value to 0.5.
- Click Save. The parameter is now available in the Parameters panel.
- Next, add a Code Node.
- Hover over under the Set limit nodes and click the + icon.
- Select Code Node.
- In the Logic tab, paste the code below that sets the cap limit:
if data.past_due_amount > 500:
data.limit = data.limit * params.limit_multiplier
With each of these nodes completed and added to the Flow, the logic is now fully implemented. Move to the next section to configure what kind of data is returned by the Decision Flow.
Configure an Output Schema
Output Schemas control what data is returned in the output of a Flow. Output Schemas are customizable, allowing you to determine the information a Flow returns.
Output Schemas are configured from the Schemas tab. Complete the following steps to configure the Output Schema of this Flow:
- Open the Schemas Panel
- In the sidebar, navigate to the Schema tab.
- Define Output Fields
- Select the Output tab.
- Click Add Field and define the following fields:
| Field name | Data type | Required | Nullable | Store in decision history |
| customer_id | Number | Yes | No | Yes |
| decision | String | Yes | No | Yes |
| limit | Number | Yes | Yes | Yes |
Note that the limit field can be None for customers who are excluded due to the age knockout rule at the beginning of this Flow.
Next, test the schema by clicking Test. An error will occur because the limit field is required, but it is not assigned for customers rejected due to age. To resolve missing values, and in this case the missing limit value for rejected customers, nodes can be adjusted to return default values. To resolve the missing limit value for rejected customers, follow these steps:
- Locate the Yes, Customer Rejected branch.
- Hover under the branch and click the + icon.
- Select Assignment Node.
- Configure the node:
- Title: Set limit to None
- Set Value Of: data.limit
- Value: 0 (or None, depending on system handling)
- Click Test again to verify that the error is resolved.

Now that our dataset, inputs, nodes, and outputs are complete, we can now test our Decision Flow.
Test the Decision Flow
The Decision Engine's Test and Expected Outputs features make it easy to ensure the results of the Flow are as intended. In this final step of building a Decision Flow, let's configure testing outcomes and run a test.
As mentioned, the Expected Output feature allows you to include expected outputs for individual test cases within your datasets. During a Test run, the actual output generated by the Decision Flow is compared with the expected value for each test case.
In this test scenario, we'll need to include the expected decision and limit values, both of which must be determined based on the logic established earlier. You can configure this within the sample data editing view. Complete the following steps to configure the expected outcomes:
- Navigate to the Test data tab.
- Choose the sample data for the test run.
- Click the dropdown menu located on the right side of any data field, such as past_due_amount.
- Select Add expected output field.
- Set the expected outcomes for both decision and limit based on the decision logic.
- Click Done to save and exit the sample data modal.

Next, click on Test to check if the expected outcomes match the values derived from the decision logic. To view results, proceed to the Inspect data tab within the Output Node.

The results of our Decision Flow matched the expected outcomes, as displayed by the Successful, Failed, and Output mismatch values.
Once your Decision Flow starts receiving live traffic (for example, when your first customers submit loan applications), you can explore the decisions made in the Decision History tab. Each entry in the Decision History represents an individual request made to the production/sandbox API endpoint. By clicking on a particular record in the list, you can track its journey through your Decision Flow, with intermediate outcomes at each step.

Now that we have confirmed the decision logic is performing as intended, we can publish the Decision Flow and allow live traffic.
Publish the Decision Flow
Publishing a version of the Decision Flow changes its status from Draft to Live, which means that you can no longer edit it. This is done to protect published flows because they need to reliably handle production traffic.
To publish the Decision Flow, navigate to the Versions page by clicking on the name of the Flow. Next, click the three-dot menu icon and click Publish.

Next, click Publish to finish.
