@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.