Multi path flows using split module
The Split module allows you to create condition groups to direct and route messages to various outputs. At least one group is required, and messages that match the conditions in a group will be passed through to the corresponding output. If a message matches the conditions of multiple groups it will be delivered through all the corresponding outputs. This enables flexible and dynamic message routing based on specific criteria. By setting up various condition groups, you can ensure messages reach all relevant destinations in your Flows.
Let’s take an example where we start with a basic database query, using a PostgreSQL Select module. As a first check we want to make sure that we actually got a response from the database, not a timeout or some other error. We can do this by looking at the crosser.success property in the output message from the PostgreSQL Select module: if it’s true we have a valid response and can continue, if it’s false something went wrong and we want to report this in a Slack channel.
Once we know we have a valid response we want to check that it contains all the data we need. Some columns may contain null values, which will not be accepted by our destination (Salesforce in this example). A second Split module is used to check that none of the fields are null. If so, we send the data to Salesforce, otherwise we report another message in the Slack channel.