Existing Node reported as non-existent

Describe the problem/error/question

I have a WF with 2 triggers. Depending on which is fired, I follow a different path.
This decision is made a Switch.
In this switch, the switch tests which objects exists.

Unfortunately I get an erro and the situation is not consistent:
Cf. screenshot:
@left side you can see the ClickTrigger exists but is empty. That is literally what n8n states.
@right side, n8n states it threw an error as the … same object does not exist.
(?!)

Please share your workflow

Information on your n8n setup

  • n8n version: → 1.85.4
  • Database (default: SQLite): → Postgres
  • n8n EXECUTIONS_PROCESS setting (default: own, main): → own
  • Running n8n via (Docker, npm, n8n cloud, desktop app): → Docker (on render)
  • Operating system: → Ubuntu

hello @Wicked_AI_Ware

The error means the node didn’t run. You can’t refer to nodes which didn’t run.

Correct way would be this:

Thanks but … not true; the Trigger node DID run:

You can see the “1 item” along the green line there.
So the Object DOES exist.

There is more weirdness going on: (2 separate errors?)
When I test-run the “Switch” step, instead of assessing the Click-flow exists and (thus) proceed with that Route, it invariably

  • does not proceed with that Route, even if the object exists, and
  • which uncalled for: it triggers the Chat node

Also, it should not complain about a Node not existing as that is exactly what I am testing for:

So running the Switch leaves me with this end state:

Again, you CAN’T refer to nodes that didn’t execute.

Your switch has two evaluations, which impossible to evaluate, as both triggers will never be executed. The correct way I’ve provided earlier in the workflow

I see.
Thanks for the solution barn.

This will work yet… I am still left somewhat on my “logic” hunger; I find it strange you can’t test if a node exists or not.

If it did not run (which is OK) and therefore does not exist (also very OK & fair), why… is it impossible to indeed confirm that a non-existent node does indeed not exist?
?

I tried your suggestion. It does not work either; whenever I enter the Switch and test this step, it (uncalled) fires the ChatTrigger by itself, which sets the Trigger Type to ChatTrigger.
→ The “gotoTelegram” route is never reached.

How are you testing it?

There is a Test Button near each trigger, where you can test each trigger

I do not have any issues with any of the trigger

I think it’s because ‘exists’ checks if the variable exists or null / undefined. But when you are trying to access the non-existed node you will get an error, which should be processed via try/catch block.

E.g.

I am testing it with the “play” button on top of the “Click” trigger (to avoid also triggering the chat trigger).
Then I click “Play” on the Set Field Node connected just to that Trigger. Then on the “Play” of the “Switch”. All goes fine (and I can follow this with the green lines) till I reach the Switch Node.
→ Is this the wrong way?

On yr reply to test non-existent Nodes for non-existence: weird no? :slight_smile:
That should just work.

Yes, when you click the play button on the switch node (and any after it) the WF will wait for the message from the chat trigger, because that trigger has a precedence over the manual trigger

1 Like

Interesting… one learns something new every day! :slight_smile:
And about that day: you made my day - by clicking the fat red button next to the Click Trigger, it worked as expected.
So I guess your assumption about the priority is correct.
I love n8n , even if there’s still some fine-print edges I need to get familiar with (like the non-existent nodes and the “right” way to trigger, as you see)
Thanks again Barn!

If the issue was resolved, please mark my post as a solution by clicking on the little checkbox below the post so others can also see the solution. :slight_smile:

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