Invalid token type: number. Expected: Number

I’m trying to get a simple script running, where I want to read an argument and process a numeric value. To start with, I’m just reading the value.

As you can see in the attached image, the test run returns “3”, which is exactly what I expect at this stage. However, I’m getting an error message in the script test:

{"message":"Invalid token type: number. Expected: Number"}

Additionally, there’s an error from the flow card when my flow runs, causing everything to stop at that point. The error message from the card is as follows:

I can’t figure out what’s wrong. The input value is blue, indicating that it’s a numeric value, so why is it complaining?

Any ideas?

The quotes around it mean that it’s a string, not a number. To return a number, use this:

return Number(test);

Thank you !