Problems with Spotify Workflow

I have the attached workflow that I am having issues with. Everything works as expected until it gets to the final Spotify step which is to add the songs that match the IF statements to the specified playlist “Dance”. There should be 12 matching songs from this weeks Discover Weekly playlist but it only adds the first one for some reason. I thought it was only adding one in testing but I let the workflow trigger at its normal time this morning and the same thing occurred. Any insight would be greatly appreciated.

Do not understand where the problem is. If you say “There should be 12 matching songs from this weeks Discover Weekly playlist” are there then actually 12 songs, so 12 items in n8n?

Or let’s ask differently:
Is the problem that it does not return 12 songs or is the problem that there are 12 songs in n8n but only 1 gets added?

The IF statement correctly finds 12 songs but only one gets added to the playlist.

How many items does the Track-Node contain? Because if it only contains one that would cause an issue like this.

In this case the node would execute 12 times, once for every item. For each of them it would look for the correct item on both in the expression referenced nodes. For Playlist it would find data for all 12. For Track it would then only find data for the first one.

For it to work you have to tell n8n to always use the data of the first item (the item with index 0) which you can do by changing the expression for “Track ID” on the Node “Spotify1” to this value:

{{ $item(0).$node["Track"].json["Track"] }}

Had to change the Merge2 Node to Multiplex it to get it to work. Issue seemed to be that Playlist was only passing 1 result and Track was passing 12.

Yes, exactly that is another possibility. But to be complete also then the expression would still need to get changed. In this case to:

{{ $json["Track"] }}

Yeah, that is the expression being used.