[Can’t determine which item to use] cant grab data from previous nodes with weird error message

I am using the n8n cloud version.
My workflow is pretty long, now i have a weird issue.

[Can’t determine which item to use] pops up in the middle of the workflow and does not allow me to take data from a node at the beginning any more. It only allows me to take data from the previous node


I want to take Data from the Set at the beginning, but it only allows me to take Data from the Code4 Node:

I also tried the matchItem command etc. nothing works.

P.S.

as it specificly asks for something from Code4 Node in the error message allthough the content of the code4 node is not even used at this stage i add the code here:

const ratings = $input.all().map((item) => item.json.Rating);
const result = [];

for (let i = 0; i < ratings.length; i += 2) {
  const sum = ratings[i] + (ratings[i + 1] || 0);
  result.push(sum);
}

return { result };

Hello @Aleksander_Fegel

That’s the “issue”. Your code node configured in the “run once for all items” which breaks the item pairing. You can use the first().json property in the LLM node instead of the item.json to resolve the issue.

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