BUG - JSON.Stringify broke with 1.2.0 & 1.2.1

Hey there,

The latest update has broken the JSON.Stringify functionality. It is wrapping anything from that node in an additional [ ] which is breaking API requests which we are reliant on. See attached screenshot.

See screenshot of the broken request using Postman

See screenshot of it working when I remove the [ ] which n8n has now decided to add to all JSON.Stringify.

I am running N8n via Cloudron, the updates which caused this are 1.2.0 and 1.2.1 which happened at 1AM and 5AM automatically for me. I will roll back to previous version until a fix is out for this.

I think this is kinda breaking change for a lot of people who use the JSON.Stringify method in their workflows.

Hi @stuart,

Can you share the incoming data you are using in the webhook? For me using a Set node to set a value and then using the same formatting doesn’t reproduce the same issue so it sounds like maybe the data is going to be key to this one.

In my http request node

Sent to webhook.site

At the moment the only way I can reproduce this is by having body.Text as an Array instead of a string and in that case the stringify function is working correctly.

If you can share the JSON data you have on the input it would be a massive help. You can also test the above by running the workflow below.

Super strange. I am using Bubble for the input, and the bubble data looks like this;

I wish I took some more screenshots before I rolled it back to a previous version but this is a flow we have had live for some time without issue. I checked the logs to debug before I wrote the first report and it happened literally right after the update at 1AM so was working fine before that.

Now that I have rolled back the version it continues to work fine as it did before that update so totally unsure of how to replicate this issue now as I don’t want to break it again.

Screen Shot 2023-08-10 at 16.04.26 PM

This is a screenshot from my Bubble Database showing the field that we map to then send to N8n so there is nothing strange there.

In terms of the flow, it is fairly simple, I am receiving from the webhook, then immediately doing a HTTP POST to Elevenlabs API and that is where I was getting this issue before. Let me know if there is anything else I can do to help here.

Hey @stuart,

You may need to upgrade again so we can check, From my testing it looks like the issue is with the data recieved so I would need to see that so we can confirm if it is that or something else.

Hey Jon,

Made a loom video but saw I had a key exposed half way through so if you want that, please DM me or reply to the message I sent to your twitter and I can give access. I have an N8n instance on the same cloudron which I left updated and was able to replicate this by copying the full flow.

Here is how the error data comes in

and here is how it looks when with the HTTP node which errors

I am having trouble with the instance I backed up and rolled back as it is erroring when I try to show a now successful workflow but I have copied the whole thing to a new workflow and ran the same test so this is the rolled back version which works…

Data coming in like this;

The HTTP request looks like this;

I hope that helps somewhat, if you need the Loom just give me a shout.

About N8n on WORKING flow is 1.1.1.
About N8n on BAD flow is 1.2.1.

Hey @stuart,

Looking at your data you can see that the body is an array for the Text field which is why it has the 0 under it, The good news is this is not an issue with the Stringify function the bad news is this looks to be an issue with the webhook node.

As a temporary solution you can work around this by using {{ JSON.stringify( $json.body.Text[0] )}}. I am just going to see if I can reproduce the webhook issue so we can get that fixed.

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