Strangly Need to add {{ JSON.stringify ($json.output) }}

It’s not strange once you know what’s going on. Internally, in some places, n8n needs the final result of the value/input, for a node parameter, to be a valid JSON string. Sometimes a JS object (different from JSON) still looks exactly like valid JSON (double quotes, array brackets, etc.), so it might work, but you can do some things in JS object syntax that are not allowed in JSON (object notation), so just auto-converting an object to a string does not work.

This post has more detail on how you can more reliably avoid this type of issue in n8n. tl/dr => Use an expression like: {{ { anyValid: 'js object' }.toJsonString() }}

1 Like