← Verse · A-to-Mind · Fix an automation
n8n "JSON parameter needs to be valid JSON": what it means and how to fix it
You see: JSON parameter needs to be valid JSON
What it means
A node (usually HTTP Request or Set) has a JSON field whose text is not valid JSON once n8n has filled in any expressions. The usual causes are a trailing comma, single quotes, an expression that puts a value with quotes or line breaks inside a string, or a value that is empty so the field reads {"name": }.
How to fix it
- Open the failing node and look at the JSON field. Copy what the field resolves to (run the node once, or hover over the expression) into a JSON checker and read where it breaks.
- Wrap any expression that fills in text in JSON.stringify so quotes and line breaks are escaped for you, for example {{ JSON.stringify($json.message) }}, and leave the quotes off around it.
- Remove trailing commas and use double quotes only. If a value can be empty, give it a default, for example {{ $json.name ?? '' }}.
- Run the node again with Execute node, then run the whole workflow.
If it keeps coming back
If it only breaks for some items, one of them has a value you did not plan for (an empty field, a line break, a quote). Pin that item's data on the node and test with it.
Still stuck? Ask Verse, free
Paste the error and what the automation does. Verse names the likely cause and the fix, in seconds, no account.
Ask Verse about this errorOr have it fixed: $25
One broken automation, diagnosed and repaired, with proof it runs again. Reply to the receipt with what stopped.
Get the One-Time FixThe One-Time Fix covers one workflow. What you send and what you get back.