No results and continue the execution

Hi everyone

I wanted to know when a node returned “No data” if there is a way to continue the workflow execution for the following outputs: with a result and without a result.

When there is no result on the previous node the below code does not show results and the workflow halt at this point.

if (Object.keys(items[0].json).length === 0) {
  return [
     {
       json: {
         results: 0,
       }
      }
  ]
}
return [
  {
    json: {
      results: items.length,
    }
  }
];

When got result, it works.

Try setting always output data in the node settings for the node prior:

2 Likes

This worked. Thanks for your help !!

2 Likes