Hi, everyone . A friend of mine introduced me to this forum saying i can get help for my n8n problem.
i’m having an issue with an executive sub-workflow node.
i’m passing a few values from the previous node into the sub-workfow, but n8n keeps complaining about one of the inputs . the workflow runs fine until it reaches the sub-workflow.
the confusing part is that the value looks correct in the previous node.
please i need help and i am runing out of time.
@Chuks_Saint Welcome!.
Yes your friend was right this community is to help get your issues solved when working with n8n .. and we have several professional supporters here for that .
can you share a screenshot of the Execute Sub-workflow node with the workflow inputs visible?
Also , what type is the problematic input supposed to be… strings , number, boolean , or array?
And if possible , expand the input data from the previous node so we can compare the actual value with what you are passing into the sub-workflow.
sure , i have shared my screen below .
the error is showing on the fieldList. with :
“clientId, status, createdAt”
and the error :
Invalid value: Expected Array, received string
@Chuks_Saint after checking carefully…I found the issue .
your fieldsList input is configured as an array , but you’re passing it as a single string:
“clientId, status, createdAt”
so n8n is receiving:
JSON
{
"fieldsList": "clientId, status, createdAt"
}
instead of
JSON
{
"fieldsList" : [
"clientId",
"status",
"createdAt"
]
}
change the expression/value going into fieldsList so it returns an actual array.
For example ,if the previous node contains the comma-separated value, you can use:
{{$json.fieldsList.split(',')}}
or , if you already have fields as an array upstream , pass that array directly rather than converting it to a string .
n8n’s data-mapping docs explain that expressions can be used to reference and pass data from previous nodes , so the important thing here is that the data type of the expression matches the parameter type .
please check the n8n docs for reference
Ah, i see now .
i was joining the fields into a string ealier and then passing that value directly into the sub-workflow.
changed it to {{$json.fieldList.split(’ ')}} and the validation error is gone. The sub-workflow is runing now thanks a lot !
Hi @Chuks_Saint Welcome!
The joined string in your screenshot is “clientId,status,createdAt”, and split(’ ') on a comma joined string does not separate the names, it returns one element or leaves commas stuck to them. That still passes the array check, so the sub-workflow gets wrong field names. Split on the comma and trim the spaces:
{{ $json.fieldList.split(',').map(f => f.trim()) }}
Please also consider marking the reply that fixed it as the solution, it helps future readers find what actually worked.
nice
please don’t forget to hit the solution button so as to help others that have the same issues