Steps
Add a Fallback Output: unmatched items are dropped without a word
With rules for
paidandrefunded, the item with statusPaid(capital P, trailing space) matched nothing and simply disappeared. No error, no hint, and the execution showed success. In Options > Fallback Output, choose Extra Output (it showed up as a third output, index 2) or send it to an existing output. Then you can see what didn't match instead of losing it.Clean the value: whitespace beats case-insensitivity
Turning off Case Sensitive on the rule, or the node option Ignore Case, did not help:
Paidwas still dropped, because of the trailing space. Normalise the left value instead:{{ $json.status.trim().toLowerCase() }}routed bothpaidandPaidcorrectly. Remember string rules are case-sensitive by default:frdid not equalFR.Fix "Wrong type: ... is a string but was expecting a number"
Switch rules check types strictly. A Number rule on the text
"120"stopped the whole run withWrong type: '120' is a string but was expecting a number [condition 0, item 0]. The same happens with Boolean on the text"true"and with Date & Time on24/10/2026(only ISO dates like2026-10-24pass). Turn on Convert types where required on the rules (setting it in the node's options instead had no effect in our run), or convert in the value:{{ $json.amount.toNumber() }}, or{{ DateTime.fromFormat($json.date, 'dd/MM/yyyy') }}for dates. The error can also come from the right-hand value:{{ '100' }}there failed the same way.Loose mode still fails on one bad value
With Convert types where required on, a single item with
amount: "abc"stopped the run withConversion error: the string 'abc' can't be converted to a number [condition 0, item 2]. The item number starts at 0, so item 2 is the third item..toNumber()on the same value failed with onlycannot convert to number, with no node name and no item index, which is harder to trace. Filter or fix bad values before the Switch, for example with a Filter node or{{ Number($json.amount) || 0 }}.Know that only the first matching output gets the item
Rules
total > 10thentotal > 100: the item with 120 went only to output 0, and output 1 stayed empty although 120 > 100. That is the default. Turn on Options > Send data to all matching outputs and the item went to both. Otherwise, order your rules from the most specific to the most general.Watch null, missing and empty values
An item with
total: nullwas routed to the<= 100output with no error, because null compares like 0. A rulestatus equalswith an empty right value matched an empty string, null and a missing field alike: all 3 items. Use exists / does not exist or is empty rules when a missing value should go its own way;does not existcorrectly caught the item with no country.Check every output is connected, and the value is an expression
Items routed to an output with nothing attached vanished, and the run still showed success. A left value written as
{{ $json.status }}in Fixed mode (no leading=) compared the literal text and sent 0 items to every output, again with no error. Switch the field to Expression. A Switch in Rules mode with no rules also outputs nothing, silently.In Expression mode, return a 0-based number
Mode Expression worked with
{{ $json.status === 'paid' ? 0 : $json.status === 'refunded' ? 2 : 1 }}and 3 outputs. Returning 2 with Number of Outputs set to 2 failed withThe ouput 2 is not allowed.(the typo is n8n's), because outputs count from 0. Returning text such aspaidfailed withInvalid input for 'Output Index' [item 0]; the strings'0'and'1'were accepted.
What we ran
On 24 October 2026 we ran 30 executions on n8n 2.43.7 with n8n execute: a Manual Trigger, a Code node sending three items, the Switch node (version 3.2, one run on 3.1), and a No Op node on each output. Ana had status paid, amount "120", country FR; Bo had status Paid (capital and trailing space), amount "40", country fr, date 24/10/2026; Cy had status refunded, amount "abc", total null and no country.
| Setup | Result |
|---|---|
Rules status equals paid / refunded, no fallback | Ana on output 0, Cy on 1, Bo (Paid ) dropped silently; run shows success |
| Fallback Output: Extra Output | Bo on a third output (index 2) |
| Fallback Output: Output 0 | Bo joins Ana on output 0 |
| Rule Case Sensitive off | Bo still dropped (the trailing space is the problem) |
| Node option Ignore Case | Bo still dropped |
Left value {{ $json.status.trim().toLowerCase() }} | Ana and Bo on 0, Cy on 1 (fixed) |
Number > 100 on the string "120", strict | Wrong type: '120' is a string but was expecting a number [condition 0, item 0] |
| Same with Convert types where required | Conversion error: the string 'abc' can't be converted to a number [condition 0, item 2]; one bad item fails the run |
| Loose type validation set in node options instead of the rule | No effect, same Wrong type error |
{{ $json.amount.toNumber() }} with abc | Error cannot convert to number, no node name or item index |
Number > 100 / <= 100, total null | Null item routed to <= 100, no error |
| Rules > 10 then > 100, default settings | 120 only on output 0; output 1 empty |
| Send data to all matching outputs on | 120 on both outputs |
Boolean is true on the string "true" | Wrong type: 'true' is a string but was expecting a boolean [condition 0, item 0] |
country equals FR / country does not exist | FR on 0, missing on 1, fr dropped |
Date & Time is after 2026-01-01 on 24/10/2026 | Wrong type: '24/10/2026' is a string but was expecting a dateTime [condition 0, item 1] |
Array contains vip / Array is empty | Both work as expected |
String matches regex ^paid$ | Only the exact paid |
| Outputs 1 and 2 not connected | Items routed there vanish; run shows success |
| Expression mode, ternary returns 0, 1 or 2 | Works |
| Expression mode returns 2 with Number of Outputs 2 | The ouput 2 is not allowed. (sic): indexes start at 0 |
Expression mode returns the strings '0' / '1' | Accepted |
Expression mode returns $json.status | Invalid input for 'Output Index' [item 0]: expects a number but we got 'paid' |
Left value {{ $json.status }} in Fixed mode | 0 items on every output, no error |
| Rules mode with no rules | 0 items, no error |
Number >= with right value {{ '100' }} | Wrong type error on the second value |
| One rule with OR (country FR or status refunded) | Ana and Cy |
| status equals an empty value | Matches "", null and a missing field: all 3 items |
| Switch v3.1, same as the first run | Identical to v3.2 |
Quick checklist
- Items missing after a Switch? Add a Fallback Output and look at what lands there.
- Text that looks right but doesn't match? Trim and lowercase it in the left value.
Wrong typeerror? Turn on Convert types where required on the rules, or convert the value.- Item only on one output? Turn on Send data to all matching outputs.
- Empty outputs and a green run? Check the field is in Expression mode and every output is connected.
Good to know
- Only two branches? The IF node has the same strict type checks; see Merge and IF node pitfalls for joining branches back together. Only need to keep or drop items? See the Filter node guide. Next node not running at all: next node not running. Empty or undefined values from expressions: n8n expression errors.
- Every error message we reproduced is in the n8n error message index.
What we didn't test
- The editor UI itself, n8n Cloud, Switch versions before 3.1, and very large item counts.
Start from a working agent
FAQ
Why are items missing after my n8n Switch node?
They matched no rule, and by default unmatched items are dropped with no error. Add Options > Fallback Output (Extra Output) to catch them, then fix the rule, often a trailing space or a case difference.
Why does the n8n Switch node only send an item to one output?
By default an item goes to the first rule that matches. Turn on Options > Send data to all matching outputs to send it to every matching output.
What does 'Wrong type: is a string but was expecting a number' mean in n8n?
The rule compares numbers but the value is text, like "120". Turn on Convert types where required on the rules, or convert it with .toNumber(). Values that can't be converted, like 'abc', still fail.
What does 'The ouput 2 is not allowed' mean in n8n?
In Expression mode the Switch output index starts at 0. With 2 outputs, only 0 and 1 are valid; raise Number of Outputs or return a lower index.
Is the n8n Switch node case sensitive?
Yes, string rules are case-sensitive by default. You can turn that off per rule or with Ignore Case, but neither removes spaces, so trim and lowercase the value for reliable matches.
Related guides
- n8n Filter node not working: items removed, type errors and empty checks, 32 runs
- n8n Edit Fields (Set) node not working: dropped fields, type errors and invalid JSON, 29 runs
- n8n expression errors and empty values: 29 tests, every message explained
- n8n Send Email (SMTP) errors: timeouts, 535 Invalid login and SSL fixes, 37 runs
- n8n "Model output doesn't fit required format": 35 tests, fixed
New guides
- GitHub release notifications in Slack (any public repo, stable releases only)
- Send RSS feeds to Slack with a keyword filter (free, incoming webhook)
- Forward emails to a Slack channel (Gmail, Outlook, any IMAP), free with an incoming webhook
- n8n Google Sheets Trigger not working: not firing, activation errors and fixes