ERROR: No data got returned. Always return an Array of items!
Error: No data got returned. Always return an Array of items!
at Object.execute (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Function.node.js:70:19)
at async /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/src/WorkflowExecute.js:369:47
There is probably a silly mistake somewhere. Where do I fall short?
Thanks!!
You can try the below code snippet. It creates a new empty array, stores the list data into the stream variable, and then pushes it to the new array. We are then returning the newArr.
var newArr = []
var stream = items[0].json.list
newArr.push({json:stream})
return newArr;
You can read more about the function node on our official documentation.
It is a property of the items that get passed around in n8n. Every item has to have it. You can find documentation about the data-structure n8n uses here: