Summary:
When trying to dynamically pass a value from a previous node into a JSON body in the HTTP Request node (for triggering an Apify actor), n8n returns "JSON parameter needs to be valid JSON"
even though the value exists and works when hardcoded.
What Iâm Trying to Do:
Use an HTTP Request node to trigger Apifyâs Puppeteer Actor with a dynamic startUrls
value taken from a previous node using the expression:
json
CopyEdit
"startUrls": [
{
"url": "{{$('Edit Fields1').all()[0].json.url}}",
"method": "GET"
}
]
The value exists:
json
CopyEdit
{
"brand": "Justlease",
"url": "https://justlease.nl/ford-private-lease"
}
But n8n gives this error:
json
CopyEdit
"error": "JSON parameter needs to be valid JSON"
What Iâve Already Tried:
Set node to explicitly define
url
as a field.Tried both:
{{$json.url}}
{{$('Edit Fields1').all()[0].json.url}}
Confirmed body is set to JSON, not Raw.
Replaced test step with full workflow execution.
Confirmed it works only when hardcoded.
Still throws 400 / Invalid Input when dynamic.
What the Output Looks Like:
When using dynamic value:
swift
CopyEdit
{
"error": {
"message": "400 - \"{\"error\": {\"type\":\"invalid-input\",\"message\":\"The input JSON must be object, got \\\"string\\\" instead.\"}}\"",
"name": "AxiosError"
}
}
About n8n:
- n8n Version:
1.85.4
- Source Code: GitHub - n8n-io/n8n: Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.
- License: Sustainable Use License + n8n Enterprise License