Issue with No data found for item-index: "0"

Describe the problem/error/question

I have this workflow running live on production. It works pretty well. BUT when I want to inspect an execution to make some improvements and I want to inspect a request node to see which data it used, I get this No data found for item-index: “0” error.

But the node did actually run succesfully, and it processed the correct data. So it seems that the data is mapped correctly, but just not visible in an execution.

What is the error message (if any)?

No data found for item-index: “0”

Please share your workflow

example of error node

exampleoferror1

Information on your n8n setup

  • n8n cloud 1.16.0:
  • Database (default: SQLite):

How can I best handle this error? Thanks in advance for your help.

Hey @Jelle_de_Rijke,

I have seen that sort of thing happen when you have 2 nodes going into one node, The editor can sometimes get confused as it doesn’t know which of the nodes to get the data from to display. There isn’t really a pretty way to solve that at the moment but I will check to see if we already have a bug ticket open for that.

This issue is also not likely to be linked to the one you are seeing in the ticket you opened.

Ok thanks for the response, Jon. I see your point regarding connect 2 nodes to 1 node. However, this problem occurs in a node with a single connection, in this workflow, as well.

nodesingle

Any suggestions on how to change this workflow, in order to be able to properly see execution data?

Your are using deprecated syntax $node["node name"]. Please try with $("node name") instead. And see if that works. Thanks!

1 Like

Awesome Jan, That worked! :grinning: :partying_face:

So now I use this syntax

$('node_name').item.json

But I noticed that in the code node this doesn’t seem to work.

This does work:

const attributes = $node["node_name"].json.result.instance.attributes;

Am I missing something for the code node or is this the correct syntax for in the code node? (run once for all items).

Hey @Jelle_de_Rijke,

The code node doesn’t support the .item option, instead you might need to use .all() then loop over those items as needed. You can find the different options for this here: Output of other nodes | n8n Docs

1 Like

Exactly as @Jon pointed out.

In the Code-Node, the best thing to use would be the following syntax, where you can supply the index of the item. It will make sure that it uses the pairedItem information to resolve correctly:

$("<node-name>").itemMatching(itemIndex)
2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.