Strange Behavior in Edit creating an Array

Describe the problem/error/question

I’m using an edit node to rename an array named “tables” by using
JSON.parse(JSON.stringify($json.tables))
(I know, kind of overkill)

But VERY bizarrely, the value of one of the elements of the array is being changed. I cannot figure out how that could possibly be happening. See Screenshot:

What is the error message (if any)?

The “name” value in the red box should match the name in the green boxes. Note that the table id above it is the same, just the “name” value has changed. I don’t get it.

I have restarted N8N twice, thinking maybe it’s some weird caching problem. No luck.

Please share your workflow

Share the output returned by the last node

Information on your n8n setup

  • n8n version: 1.50.2
  • Database (default: SQLite): Postgres
  • n8n EXECUTIONS_PROCESS setting (default: own, main): n/a
  • Running n8n via (Docker, npm, n8n cloud, desktop app): npm
  • Operating system: Ubuntu

FYI, restarting N8N didn’t fix this, but rebooting the entire machine seems to have fixed it.

I’ve set up N8N for at least half a dozen clients now, and I run my own business on with dozens of N8N automations. This kind of weirdness makes me very nervous.

Hi @Lee_S,

Sorry that you’re experiencing this issue — I haven’t been able to reproduce this issue so far but I’ll make sure to report this internally and will keep you posted!

You can write just {{ $json.tables }}. There is no need to create a copy of the array in the Edit Fields node

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.