the lookup table approach is the way to go for complex routing. instead of chaining condition nodes, create a routing table with columns like: lead_source, company_size_range, industry, assigned_rep, email_template
then in your workflow: read the routing table, find the matching row based on the lead data, and use the assigned_rep and email_template from that row
this way when routing rules change you just update the table, no workflow editing needed. weve got about 20 routing rules and managing them in a table is way cleaner than a visual spaghetti of condition nodes
the lookup table idea is brilliant. cant believe i didnt think of that. my workflow currently has 8 condition nodes and its impossible to understand at a glance. going to refactor this weekend
we use this pattern for our lead routing too. the routing table also doubles as documentation since you can share it with the sales team and they can see exactly how leads are assigned
another approach for simpler cases - if you only have 3-4 branches, the switch node (if it exists here, cant remember the exact name) is cleaner than chaining if/else. its like a switch/case where you define the value to check and all the possible outputs
but yeah for 8+ conditions the lookup table wins every time
this is a pattern i use in code all the time (config-driven routing instead of hardcoded if/else). cool to see it applied in a visual workflow builder
lookup table approach ftw. we also add a priority column so if a lead matches multiple rules we use the highest priority one