Bug in Filter Node: "Wrong type... is a string but was expecting a number" even with Type Conversion ON

Describe the problem/error/question

Hello n8n team,
I’ve been stuck for two days trying to perform a very simple mathematical filter, and the Filter Node seems to be failing to convert types properly.
My workflow:
I am pulling videos from the YouTube API. The YouTube API returns the viewCount inside statistics as a String (e.g., “485655”).
I am trying to filter out videos that have more than 15,000 views using the Filter Node.
My Filter Node configuration:
Condition: Number
Value 1 (Expression): {{ $json.statistics.viewCount }}
Operator: # is greater than
Value 2 (Fixed): 15000
Convert types where required: TRUE (Toggle is ON)
The Issue:
Even with the “Convert types where required” toggle turned ON, the node crashes and throws the following error:
Wrong type: ‘485655’ is a string but was expecting a number [condition 0, item 0]
I have also tried using Number(), parseInt(), and .toNumber() directly inside the expression, but the node either throws a syntax error or fails to evaluate the condition correctly, moving all items to the “Discarded” branch.
Is there a known bug with the strict type-checking in the current version of the Filter node? Any help or workaround would be greatly appreciated.
Thanks,
Andrés

What is the error message (if any)?

The node throws this specific error: Wrong type: '485655' is a string but was expecting a number [condition 0, item 0]

Please share your workflow

Share the output returned by the last node

The YouTube API returns the view count as a string inside the JSON:{
“statistics”: {
“viewCount”: “485655”,
“likeCount”: “15372”,
“favoriteCount”: “0”,
“commentCount”: “1074”
}
}

Information on your n8n setup

    1. n8n version: Cloud (Latest)
    2. Database (default: SQLite): Default
    3. n8n EXECUTIONS_PROCESS setting: Default
    4. Running n8n via: n8n Cloud
    5. Operating system: Windows 11

This sounds like a data type mismatch.

There are 2 ways to get around it

1) Convert data to number type

This will casts the value to a number type

2)Change expression

Expression is changed from {{ $json.statistics.viewCount }} to {{ Number($json.statistics.viewCount) }}

Which do you prefer?

thank u very much :folded_hands:t2: