Set node errors when data is not executed

Describe the problem/error/question

I have an IF that splits an action into two paths and a merge:

the IF checks if entry is Master or not, IF it’s master executes the two API at the top, if it’s not a master skips those two API

Then I have a Set node that “recaps all the data” to make it easier to access the data in the next nodes. But when the two API at the top don’t execute I get this error:

What is the error message (if any)?

Referenced node is unexecuted

An expression references the node ‘xxxxx’, but it hasn’t been executed yet. Either change the expression, or re-wire your workflow to make sure that node executes first.

Information on your n8n setup

  • n8n version: 1.36.2
  • Database (default: SQLite): postgres
  • n8n EXECUTIONS_PROCESS setting (default: own, main): queue
  • Running n8n via (Docker, npm, n8n cloud, desktop app): docker
  • Operating system: ubuntu 22.04

Hey @yukyo,

Looking at your expression syntax you are using the older $item("0").$node["nodename"] which has been replaced with $('nodename').first() I would start by updating all of your expressions.

The next thing to check is has the node the expression is calling been executed and has an output? If the node doesn’t run you won’t be able to reference it, This was something that changed with the launch of v1 so I wonder if maybe you were using a very old version and recently updated.

We did add $("<node-name>").isExecuted recently which you can use to determine if a node has executed before trying to use the value which could help you in this case.

3 Likes

I get the expression syntax using the n8n in-built method:

image
(Which seems, per your comment, it gives old syntax)

What happens if I don’t update the expressions? I have about 100 workflows with a lot of steps in each one that uses the expression from the above screenshot…

As explained in the post @Jon the node didn’t execute because the IF determined the current entry is not a master so the two API at the top didn’t run (which is what’s grey in the second screenshot).

PS: I’m running almost the latest version, and this is a fresh new instance created 3 months ago…

PS2: Can’t you guys add in a future update something that auto-converts automatically ALL the old expression to the new one for us? I mean If I have to change each expression it could take a year

Very handy, I solved my problem with that expression with a simple if check:

However I wish there was a way to do it directly in the “Set node” to avoid extra steps!

Please @Jon can you please check why the n8n editor expression copy still outputs the old expression syntax?

Would you guys consider this?

Thanks!

1 Like

Hey @yukyo,

I will get a ticket raised about the old expression style being used. We shouldn’t need to auto convert all the old options as they should still in theory work which I suspect they are here but the issue will be that the node never runs which comes down to workflow design.

1 Like

Cool thanks

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