Currently there is no specific way of checking if any given node is the last. Maybe in the future there can be a condition to check if a node doesn't have connected outputs.
In the mean time the way to detect when a certain node has been reached is by using tags.