Create an Integration Flow
Discover how to navigate Integration Flow features, understand its components, and follow a step-by-step guide to create a simple Integration Flow rule.
In this detailed end-to-end tutorial, we will guide you through the process of creating an Integration Flow. For this use case, we will build an employee segmentation and salary increment system.
This Integration Flow orchestrates a process involving a Decision Table, where the input to the table depends on values retrieved from a PostgreSQL database based on a specific region. Finally, the same database is updated with the decision reached by that Decision Table.
The Decision Table can be created as sample right in DecisionRules platform
We'll cover navigating through the creation process, configuring Integration Flow nodes, and generating a final reporting-output containing the data updated in the database. At the end weโll test our new rule with a couple of inputs to ensure it works as expected. This tutorial will help you understand key Integration Flow components and data manipulation techniques.
Only a few node types are used in this tutorial. For a complete list of available Decision Flow nodes, please refer to our dedicated documentation page.
Logic of the Flow
IO Model
Our input model captures the key region to evaluate during the Job.
{
"employeesRegion": {}
}The output model contains the list of employees receiving a raise employeesBiggerSalary , including their names, original salary, and the percentage increase. It also includes a message indicating the total number of employees processed.
{
"employeesBiggerSalary": {},
"message": {}
}Flow Steps
Establishing clear logical steps ensures an efficient design process:
Data Retrieval: Retrieve the list of employees for a specific region and the necessary data required to determine their percentage increase.
Logic Execution: Iterate through each employee to decide the appropriate percentage increase based on business conditions.
Data Update & Reporting: Update the database with the new calculated salary and collect key values to generate a final report.
Building the Integration Flow
Now that weโve outlined each step in the flow, itโs time to build our rule. In this section, weโll configure the IO model, add and connect nodes, and map data across the flow to create the process.
Create a new blank Integration Flow. Switch from the "Designer" tab to the "Model" tab at the top of the screen to set up your Input and Output models as described above. Once defined, these variables (employeesRegion , employeesBiggerSalary , message) will be available throughout the flow.

Don't forget to save your I/O model.
1. Data Management Input
Now it's time for adding first nodes to the canvas. Start by adding a PostgreSQL node, drag-and-drop this node from the palette on the left, and connect the Start node to it. This node will define the list of employees to be evaluated.
Click the node to open the configuration window and set the following:
Connector: Select your pre-configured PostgreSQL connector.
SQL Statement: Enter the query to retrieve the precise data.
Mapping: Use the Data Dictionary to map the input variables.
Recommended SQL statement:
The SQL statement will diverge according to the nature and structure of your database.

Remember that you can 'drag-and-drop' the attributes for mapping data, from the Data Dictionary inside the nodes.
2. Percentage Increase Selection
We will now use a Decision Table called "Salary Increase Table" to decide the percentage increase for each employee.

Because we are processing multiple employees, we will use the Loop hook at the bottom of the PostgreSQL node to repeat the evaluation for every row retrieved.
To call the Salary Increase rule in the flow, drag a Business Rule node onto the canvas and connect it to the Loop hook of the PostgreSQL node. Inside the Business Rule node:
Select the Salary Increase Table.
You can keep Strategy and Rule Version configurations as they are.
Since you are in a loop, in the Input Mapping, map the salary from the postgresql.currentRow to the rule input.

3. Data Management Updating
This step is divided into two parts: pushing results to the database and generating a report.
Part A: Updating the Database To update the salary in each iteration of the loop, drag a PostgreSQL Single Row node onto the canvas and connect it to the Business Rule node.
To set this node follow similar steps to the last Data & Integration node, but in the Query field, enter the following statement:
Becareful mapping the attributes-variables.

Part B: Generating the Report
Weโve now completed the main goal of the Integration Flow. But as a corollary, a second part generates a simple job's report for immediate checking.
To collect a list of all processed employees (including ID, Last Name, Original Salary, and Pct Increase), start by adding a Collect node. Drop it and connect it. Open the node and create a new Target called salary_report . Configure the data structure of this new object creating an Attribute for each of the properties you want to report. After it, map the data from the Data Dictionary corresponding to the properties in the loop.


After collecting all the information, we'll use the salary_report to populate the output attribute employeesBiggerSalary . Drag an Assign node from the palette and drop it on the canvas next to the first PostgreSQL node. Connect the Exit hook of the PostgreSQL node to the new Assign node. This ensures the branch executes only after the entire loop is complete.
Map the data for the assignment: Open the new node, move the two outputs of your model to the Target fields, and use the salary_report for the first one; use the native rowCount of the PostgreSQL node to paremeterize the message of the second one:

Finally, add an End node after the Assign node. You can use the Inspect tab on the End node during execution to see a final snapshot of all processed data.
Congratulations! ๐ You've completed the Integration Flow, which might look something like this:

In the next section, weโll test the Integration Flow with a couple of inputs to ensure itโs functioning correctly. Before proceeding, please double-check that all Integration Flow nodes are fully configured and properly connected.
Testing the Integration Flow
Testing your Integration Flow with sample inputs is essential to confirm it works as expected. We recommend testing with different regions (e.g., "West" and "East Australia").
The good performance of the flow depends strongly on the content and structure of your database. This example is for a possible table called "employees_australia".
Open the Test Bench.
Input a sample region: {"employeesRegion": "West"}.
Click Start a New Job to test and review the results. This allows you to verify that each node is executing correctly and that data flows as intended.

If the database is very big or complex, the process could take several minutes. Running this Jobs you will have a dashboard to check the status of each one. Navigate to the menu through Space โ Jobs:

Webhooks
To complete your setup, you can integrate Webhooks to notify your external systems when a job finishes.
First, you have to link the Webhook to your Space.
Global Management: Navigate to Space โ Webhooks and click the + Add Webhook button.
Endpoint URL: The destination address where DecisionRules will send the data.
Alias: A unique name to identify the webhook within your Space.
Events to Send: You can choose which Job statuses trigger the webhook. For example, you might have one webhook for Successful executions and another for Cancellations or Errors.
Status: A toggle to quickly enable or disable the webhook without deleting its configuration.

Second, inside your Integration Flow, click the "Webhooks" button in the top-right corner and select the webhook you just created.
To verify that your setup is working correctly before connecting your production systems, we recommend using a tool like webhook.site.

Test final connection of your Webhooks in similar way, starting a new Job for the flow, either in the Test Bench or through an external API call.
Last updated