Number too large to display

Describe the issue/error/question

I am trying to use the ID 346407493004428575 as a number in a request. However, N8N reduces the number to 346407493004428540 automatically. I suspect because the number is too large for the data type.

What is the error message (if any)?

No error.

Please share the workflow

Share the output returned by the last node

What I have tried

First I tried sending the ID as a String, however, the API expects an Integer and therefore I receive an error.
Then I tried changing the data type by wrapping the number in the BigInt() function. This resulted in an error in N8N:
[invalid (Do not know how to serialize a BigInt)]
It would be great if the number format would support greater numbers.

Information on your n8n setup

  • n8n version: 0.171.0
  • Database you’re using (default: SQLite): PostgreSQL
  • Running n8n with the execution process: own(default)
  • Running n8n via: Docker

Hey @laurens-novyx,

This is one of those javacript oddities where as a Number it can only deal with up to “999999999999999” before having issue. I know how we can display the larger number but for sending it I am not sure, This is something that @RicardoE105 may have a clever answer for.

Ahh for that seems like we have to use BigInt. However, when try it to use on an expression it does not work.

I got as far as working out if I use BigInt() I have to also add .toString() so it can be displayed which is odd.