passing this complex data structure has been tough for me in n8n. tried using fn node to send it by copy pasting json and tried strigifying it to ( does not gets passed as json). http req node unable to read and send the data as it is in json.
Describe the problem/error/question
need to send a complex array such as
“seriesEntities”: [
{
“seriesId”: “12345678909871”,
“entities”: [
“123454156256787698”
]
}
],
What is the error message (if any)?
error is in the preview of code it is reading the data as [Object object] or even if stringified the data , then req is sending bad parameters message.
Please share your workflow
(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)
Without further context it is hard to spot where the error lies. However from what I’ve gathered you want to turn an array into a clean JSON structure which will be passed into an HTTP Request node afterwards. ‘Information Extractor’ node seems like the logical solution(Refer to workflow).
However, to use this node you need an AI model. For development you can use the free OpenRouter models but for production you may need to use a paid one. Also, don’t forget to stringify the array before passing it into the Information Extractor.
actually the problem is this. As you can see in the screen shot here my data is in proper json in input but when i drag drop it into json body for a http req it shows [Object object] as result. If i stringify the result and send the request, the request is not getting accepted ( probably backend might be seeing the body as string) . My array is a complex array whose single element is a pair of arrays.
plus I am new to n8n (less than 14 days) , so have very less idea about other complex stuff. have been stuck on this for last 5 days. would be very helpful if anyone can help me out here. the ss you see above is of method using a function node prior to my http req node to get proper json in advance, but it was not successful. Already tried stringifying the json body but backend saying that it needs json (possibly viewing the incoming body as string.) also tried directly using {{ $json.body}}, same problem, showing me [Object object].