Test an n8n lead routing workflow with five fake leads
Quick answer
Test an unpublished copy of the n8n workflow with five fictional leads. Replace CRM and messaging actions with Edit Fields nodes, then pin the input and run the workflow manually. Check the IDs in each output. Sales gets L02, Nurture gets L01, and Review gets L03, L04 and L05. n8n data pinning · Switch node options

A lead with an assigned owner scores 80 and still misses the sales queue. To catch that bug before a demo, give your n8n workflow a lead at 79, one at 80, and one that should never reach a rep. Run them together and account for every ID. Here is a five-record rehearsal you can use.
Build a test copy with three visible destinations
Use a separate, unpublished workflow with a Manual Trigger. Disconnect any CRM write, messaging or outbound request nodes. Put an Edit Fields node at the end of each route and set a field named route to Sales, Nurture or Review. Keep the incoming ID in its output. An endpoint like this lets you inspect a result on the canvas. Pinning data upstream freezes that node’s output during manual testing. Downstream nodes still execute. n8n manual executions · Pinning and mocking data · Edit Fields
Use this example routing policy. A lead with a numeric score from 0 through 100 and a known owner goes to Sales at 80 or above. Below 80 it goes to Nurture. Missing scores, out-of-range scores and unrecognized owners go to Review. For this exercise, put Mina on the list of known owners.
Pin these five input records
Place a Code node between Manual Trigger and Switch. Select JavaScript and Run Once for All Items, then paste the fixture below. Execute that node, confirm its output shows five items, and pin the output. Each lead needs its own item for the Switch to test it separately. n8n Code node · n8n data structure
return [
{ id: 'L01', owner: 'Mina', score: 79 },
{ id: 'L02', owner: 'Mina', score: 80 },
{ id: 'L03', owner: 'Unassigned', score: 95 },
{ id: 'L04', owner: 'Mina', score: null },
{ id: 'L05', owner: 'Mina', score: 101 }
].map(lead => ({ json: lead }));
L01 and L02 straddle the cutoff. L03 has a high score and an unknown owner. L04 has no score. L05 is outside the scale.
In the Switch node, choose Rules. For each rule select a Boolean comparison, set the value to Expression and choose “is true.” Paste this expression for Sales.
{{ $json.owner === 'Mina' && typeof $json.score === 'number' && $json.score >= 80 && $json.score <= 100 }}
Use this one for Nurture.
{{ $json.owner === 'Mina' && typeof $json.score === 'number' && $json.score >= 0 && $json.score < 80 }}
Set Fallback Output to Extra Output and connect it to Review. The default ignores unmatched items. Leave “Send data to all matching outputs” off so each item takes only the first matching route if someone later changes the rules. n8n Switch settings
Count IDs before you call the test a pass
Run the whole test workflow manually. Open the three final Edit Fields nodes and read the IDs. Sales should have L02, Nurture should have L01, and Review should have L03, L04 and L05. Counting to five catches a missing item. Checking the IDs also catches one duplicated item masking a different one that vanished.
Now change L03’s owner to Mina in the pinned data and run again. Only L03 should move, from Review to Sales. If anything else moves, inspect the two rule outputs before reconnecting a destination. Pinned data applies to manual executions. Keep the test copy and its fictional inputs for the next routing change. n8n data pinning
Questions
Why can a lead disappear from an n8n Switch?
In Rules mode the default fallback ignores unmatched items. Select Extra Output, connect it to a named review branch and include an intentionally unmatched item in your test. n8n Switch options
Will pinned input keep a manual test from sending a real message?
Pinning reuses the chosen node’s output. A connected downstream action can still run. In the test copy, replace write or send nodes with Edit Fields outputs before executing the workflow. n8n manual executions · n8n data pinning