How do I route new website form leads to the right salesperson in n8n?
Use the Switch node. Put your form trigger first, then add one routing rule per salesperson (for example by region, company size or product interest), and turn on the fallback output so a lead that matches nothing goes to a default owner instead of disappearing. By default Switch drops items that match no rule, which is the most common way leads get lost.
Automation Blueprint — £217.50 one-time. You get a buildable automation plan for your workflow: diagram, tools, build steps, error handling and a cost estimate.
Get Automation Blueprint →
Key takeaways
- The n8n Switch node docs say the node routes items to different outputs based on comparison conditions, like the IF node but with multiple outputs. It has two modes: Rules, where you build a matching rule for each output, and Expression, where you write an expression that returns the output index and set the number of outputs.
- Rules compare by data type: String, Number, Date and Time, Boolean, Array and Object, each with its own comparisons (for example Array offers "contains" and "length greater than"). You can rename each output to track where items go.
- Options: Fallback Output controls items matching no rule, with None (the default, which drops the item), Extra Output (a separate output) or Output 0. Ignore Case ignores letter case. Less Strict Type Validation tries to convert value types. "Send data to all matching outputs", when on, sends an item to every matching output, otherwise only the first.
- The n8n error handling docs say an error workflow can alert you when an execution fails, and the Stop and Error node lets you fail on purpose, for example when a required field is missing.
- The Slack node docs say Message > Send posts to a channel, which is a simple way to tell a salesperson about their lead.
- These are n8n's own docs. They do not cover business rules like fair rotation of leads, which you design yourself.
Who this is for / who it is not for
This is for you if you have a small sales team, leads arrive from website forms, and you want each lead assigned by simple rules (region, size, product) without a full CRM routing product.
It is not for you if you need round-robin with availability, working hours and quotas across a large team, or your CRM already does routing, where the CRM's own assignment is simpler and safer. Round-robin needs state (who got the last lead), which is more than a Switch node.
The key decision is the rule order and the fallback. Because Switch sends an item to the first matching output unless you turn on "all matching", the order of rules matters. And every routing flow needs a default owner for unmatched leads, or an alert.
Automation Blueprint — £217.50 one-time. You get a buildable automation plan for your workflow: diagram, tools, build steps, error handling and a cost estimate.
Get Automation Blueprint →
Describe your automation in plain words and get a diagram, the right tools, build steps and a cost estimate.
Switch options for lead routing
| Option | Setting | Effect on leads |
|---|---|---|
| Mode | Rules | One rule per salesperson or segment |
| Fallback Output | Extra Output | Unmatched leads go to a default path |
| Fallback Output | None (default) | Unmatched leads are dropped, avoid |
| Ignore Case | On | "uk" and "UK" match the same rule |
| Send data to all matching outputs | Off | Each lead goes to one owner only |
| Rename Output | Names like "North" and "South" | Easier to read the workflow |
Source: n8n Switch node documentation.
Step by step
- Choose the trigger. A Webhook node receiving the form post, or a form trigger. See how to set up your first webhook and how to automate website form leads into a CRM.
- Clean the fields you route on. Use a Set node to trim and standardise values such as country or company size.
- Add a Switch node in Rules mode. Create one rule per salesperson, for example country is one of a list, or company size greater than a number.
- Rename the outputs after the salespeople or segments.
- Set Fallback Output to Extra Output, and send that path to a default owner or a shared channel.
- Decide on overlap. Leave "Send data to all matching outputs" off unless a lead should reach several people.
- Notify each owner and write to the CRM. Connect each output to a Slack message and a CRM create step. See how to send Slack notifications from an automation and how to automate Facebook lead ads into your CRM.
- Test with sample leads for each rule, plus one that matches nothing. See how to test a webhook before connecting a live app. Then add an error workflow. See how to handle errors in n8n and Make.
Worked example: three salespeople by region
Example, assembled from the documented options with an invented team. Leads come from a website form with a country field. Aisha takes the UK, Ben takes the EU, and Carla takes everyone else.
| Output | Rule | Goes to |
|---|---|---|
| Aisha | Country equals UK (Ignore Case on) | Slack message to Aisha, CRM owner Aisha |
| Ben | Country is one of a list of EU countries | Slack message to Ben, CRM owner Ben |
| Fallback (Extra Output) | Anything else, including blank | Slack message to Carla, CRM owner Carla |
The builder tests four leads: a UK lead, a Germany lead, a lead with the country written as "united kingdom" (to check the rule), and a lead with the country blank. The blank one falls to the fallback and reaches Carla, rather than being dropped. If a rule is later changed so a country matches two rules, the builder knows only the first match gets the lead, because "all matching outputs" is off. The team and rules are invented to show the method.
Alternatives
- Use the IF node for a simple two-way split. See Zapier paths vs Make router vs n8n switch.
- Use Expression mode if your routing logic is a formula that returns an output number.
- Let the CRM assign with its own routing rules, if it supports them.
- Round-robin with stored state, using a data store or sheet to remember who got the last lead. See how to keep state between runs.
- Manual triage by one person for low lead volume.
Is there a tool that plans an automation, with error handling, before I build it?
Yes. Asendify's Automation Blueprint takes your described workflow and returns a buildable plan: a diagram, the tools, build steps, error handling and a cost estimate. It suits people who want the routing rules, the fallback owner and the failure alert designed before they open n8n. It is a plan, not a hosted automation. Free alternatives are the n8n docs above and the n8n community. See how to plan an n8n workflow from a plain-English description.
FAQ
What happens to a lead that matches no rule?
By default the Switch node drops it. Set the Fallback Output to Extra Output or Output 0, per the n8n docs.
Can one lead go to two salespeople?
Only if you turn on Send data to all matching outputs. Otherwise it goes to the first match.
Does the order of rules matter?
Yes, when "all matching outputs" is off, the first matching rule wins.
Can I ignore upper and lower case?
Yes, turn on Ignore Case.
Can I do round-robin?
Not with Switch alone, because it needs stored state.
Automation Blueprint — £217.50 one-time. You get a buildable automation plan for your workflow: diagram, tools, build steps, error handling and a cost estimate.
Get Automation Blueprint →
More guides on other topics: https://www.asendify.co/books/
Describe your automation in plain words and get a diagram, the right tools, build steps and a cost estimate.