I looked through the first 5 google pages about this problem, talked to gpt yesterday for a few hours, no solution ever. So it is simply a bug.
Is there any way to “clean up” the code in another node?
I tried to get around the bug by using database Baserow in between and first save the text there, and retrieve it, but still once in a few times of bot responses, n8n recognizes that JSON is still invalid.
All the data below is from the same request.
ERROR: JSON parameter need to be an valid JSON details:
NodeOperationError: JSON parameter need to be an valid JSON
at Object.execute (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/HttpRequest/V3/HttpRequestV3.node.js:1070:35)
at Workflow.runNode (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/Workflow.js:652:51)
at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/WorkflowExecute.js:596:68
at processTicksAndRejections (node:internal/process/task_queues:96:5)
JSON that is causing the problem. According to the validators, it has the correct format:
[
{
"id":
1,
"order":
"1.00000000000000000000",
"Wiadomosc":
"wymień listę 10 komedii lat 80",
"Odpowiedz":
"The Breakfast Club 1985 Ferris Buellers Day Off 1986 Ghostbusters 1984 Airplane 1980 The Princess Bride 1987 Trading Places 1983 National Lampoons Vacation 1983 Caddyshack 1980 The Naked Gun From the Files of Police Squad 1988 This Is Spinal Tap 1984"
}
]
The whole core of communication of the upper weather branch with the last Signal node has been tested for several months and works without problems.
After adding the OpenAI node, Signal sometimes fails to parse the code and returns a JSON error.
If anyone knows how to effectively call a “check message” request, I’d be happy to learn.
BTW
With this I have the same problem, every few answers the same error appears. So it seems to me that the problem may be with the OpenAI output.