This behavior and the solution are described in the official documentation and community answers:
-
“You can avoid
.itemby using.first(),.last()or.all()[index]instead. They require you to know the position of the item that you’re targeting within the target node’s output items.”
Item linking errors | n8n Docs -
“If, for any other reason, you are only interested in the first item… if the thread that links output items back to their source items is broken or ambiguous, and you cannot use
$item.”
Can’t understand .first()
So, while it may feel “off,” using .first() or .last() is the correct and necessary approach in these situations due to how n8n’s item linking works after merges and branches.