Cannot assign to read only property 'name' of object 'Error: Referenced node is unexecuted'

Hello n8n Community,

I’m encountering a critical issue with my n8n workflow and would greatly appreciate any assistance or insights.

Workflow Description:

  • Structure: I have a Split In Batches node where, for each project, I determine the platform using a Switch node.
  • API Requests: Based on the platform, I make API requests to retrieve all orders from an endpoint that supports pagination.
  • Data Retrieval: To fetch all items from the “Wake Get Orders” node, I use the following code:
    const allOrders = $items("Wake Get Orders").map(item => item.json);
    
    This approach has worked flawlessly in the past without any issues.

Current Issue:
Recently, I started receiving the following error:

Cannot assign to read only property 'name' of object 'Error: Referenced node is unexecuted'

The error message suggests that I’m attempting to access an unexecuted node. However, as shown in the attached screenshot (not provided here), the “Wake Get Orders” node has been executed 7 times.

Environment Details:

What I’ve Tried:

  • Verified that the “Wake Get Orders” node is indeed executing multiple times.
  • Checked the node configurations to ensure there haven’t been any inadvertent changes.

Request for Help:
Has anyone experienced a similar issue or can provide guidance on what might be causing this error? Any troubleshooting steps or insights would be immensely helpful, as this is impacting a critical part of my workflow.

Thank you in advance for your support!

Information on your n8n setup

  • n8n version:
  • Database (default: SQLite):
    n8n Version: Running version [email protected] on the cloud.
  • **Operating system:OS

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

Hey @Eduardo_Moscatelli , you don’t seem to reference the previous node correctly. Please, refer to Output of other nodes | n8n Docs. I expect to see something like below instead

const allOrders = $('Wake Get Orders').all().map(i => i.json);

Thanks @ihortom , I tested the code you suggested and it still gives the same error message.

Right, I think that is because you use 2 outputs in the “Wake Get Orders” node. More over, it has more than one iterations (7 in your sctreenshot). That means you need to state what output and what iteration you are after. Please, refer again to Output of other nodes | n8n Docs.
Note the syntax all(branchIndex?, runIndex?). That is, as an example, all(0, 5) would imply the first output (“sucess” in your case) and the 6th iteration (both are zero based).

Thanks @ihortom , I have 7 executions for my node and I need to retrieve all the items at once! The expression that indicated $(“node_name”).all(branchIndex?, runIndex?) even leaving only $(“node_name”).all(); does not retrieve all the items. And the parameters (branchIndex?, runIndex?) indicate the retrieval of a specific execution which is not my case.

Would you know which expression I could use for this case?


I tried using $items and it gives me the same error message! I don’t know why, if it’s a n8n bug! I just know that many of the ways I used to retrieve all the items from a node’s output are not working, this error appears in this case.

Ways I’ve tried without success:
const allItems = $items(“node_name”).map(item => item.json);
const allItems = $(“node_name”).all();
const allItems = $items(‘node_name’);

All of them for this case show the error:
Cannot assign to read only property ‘name’ of object ‘Error: Referenced node is unexecuted’

It appears the reason for the loop is because you want to paginate. HTTP Request node has a built in pagination functionality. Once configured correctly, there is no need in the loop at all including the Code node you have problem with, HTTP Request node documentation | n8n Docs.

Hi Eduardo, did you have this error after upgrading from the free tier to a plan ? i just cassually started getting this same error just after i upgraded to a paid plan and add an user to my project, do not know how to fix it yet

Hi Eduardo, try to change $items for $node[“name of the node of the input data”].json hope it helps