Intermediate
How to design conditional branches with routers on Make
Quick Answer
Conditional branches in Make are created using Router modules that split scenario execution into multiple paths based on defined conditions. Each route can have specific filters and conditions that determine when data flows through that particular branch.
Prerequisites
- Basic familiarity with Make scenarios
- Understanding of data flow concepts
- Knowledge of filter conditions
- Experience with Make modules and connections
1
Add a Router module to your scenario
In your Make scenario, click the + button where you want to add branching logic. Search for and select the Router module from the Flow Control category. The Router will appear as a diamond-shaped module with multiple output connectors.
Tip
Place the Router after modules that generate data you want to conditionally process.
2
Configure the first route condition
Click on the first route path coming out of the Router. In the Filter section, set up your condition using the Condition dropdown. Select your comparison operator (equals, contains, greater than, etc.) and define the Value 1 and Value 2 fields. Use data from previous modules by clicking the mapping icons.
Tip
Use descriptive labels for your routes to make your scenario easier to understand and maintain.
3
Add modules to the first branch
After setting the filter condition, click the + button at the end of the first route to add modules. These modules will only execute when the route's condition is met. Connect your desired modules (like webhooks, databases, or APIs) in sequence along this branch.
4
Create additional conditional routes
Click the + button on the Router module to add more routes. For each new route, repeat the filter configuration process. Set up different conditions using AND/OR logic if needed. You can have multiple conditions per route by clicking Add AND rule or Add OR rule.
Tip
Order your routes from most specific to most general conditions for optimal performance.
5
Configure the fallback route
Create a final route without any filter conditions to serve as a fallback. This route will execute when none of the other conditional routes match. Simply add modules to this route without setting up any filters in the connection between the Router and the first module.
Tip
Always include a fallback route to handle unexpected data or edge cases.
6
Test your conditional branches
Click Run once to test your scenario with sample data. Check the execution history to verify that data flows through the correct routes based on your conditions. Look for the blue execution lines that show which paths were taken during the test run.
Tip
Use different test data sets to verify all your conditional branches work correctly.
7
Optimize and refine conditions
Review your route conditions and adjust them as needed. Use the Incomplete executions section to identify any data that didn't match any routes. Refine your filter logic by editing the conditions or adding additional AND/OR rules to handle edge cases.
Tip
Monitor your scenario performance and adjust route order if certain conditions are triggered more frequently.
Troubleshooting
Data not flowing through any routes
Check that your filter conditions are correctly configured and that the data format matches your expected values. Verify that field mappings are pointing to the correct data from previous modules.
Multiple routes executing when only one should
Review your route conditions for overlapping logic. Make conditions more specific by adding additional AND rules or reorder routes so more specific conditions come before general ones.
Router showing incomplete executions
Add a fallback route without filters to catch any data that doesn't match your conditional routes. Check the Incomplete executions log to see what data is causing issues.
Route conditions not evaluating correctly
Verify that data types match between your condition values. Use Functions like
toString() or parseNumber() to convert data types before comparison in your filter conditions.Ready to get started with Make?
Put this tutorial into practice. Visit Make and follow the steps above.
Visit Make →