Some time IF Node when it get Else next nodes dont see previous Nodes

Describe the problem/error/question

I am seeing that in some workflows I developed are been failing and when I review it could appear that in some if node when it take the else path, the next node not received input data … I am getting crazy or loosing my mind but when I put another IF node in the else path and this last node go by true path, the issue is solved… I mean, when IF validate something like, If a != b then … , else … (this part no deliver input data to the following node)… But if I put another if the issue is fixed: If a != b then … else if a == b then (then issue is fixed)

What is the error message (if any)?

NA

Please share your workflow

Share the output returned by the last node

Information on your n8n setup

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

This was previous workflow and before work properly… But know it is failing

I Fixed doing this: Look if that I had to put after else path of previous one and my workflow start working again

@Adan_Palma , you are referencing the previous nodes with $('<node_name>).item.json... syntax. That implies automatic inference of the paired items. This is fine until the pairing is broken which could be caused by the branching nodes such as “IF” and “Switch” or custom node, for example.

In the later case, n8n needs some help from you to know what item you are referring to. If the output of the refered node has only one item, replace .item. with .first(<output_branch_index>).. By default, “<output_branch_index>” refers to the first output, which implies index 0 and could be omitted.

For example, it you reference the “IF”'s false output, you would refer to it as $('<node_name>).first(1).json.... See Output of other nodes | n8n Docs for more details.

Hopefully, this should resolve the issue for you.

2 Likes

Thanks for you tips