"Set" losing value? Bug?

Hi @xewonder, this is because your Set node returns only a single item, but subsequent nodes return multiple items.

Now what would happen for an expression like {{ $node["Set"].json["insertId"] }} is that for the first item on your MySQL2 node, n8n would look up the first item on your Set node (which works). For the second item, n8n would look up the second item on your Set node which won’t work and so on.

To avoid this, you would want to use an expression like {{ $item(0).$node["Set"].json["insertId"] }} This ensures that n8n always uses the first item (with index 0) of your Set node, even when processing additional items. $item(0) is documented here.

Hope this helps! Let me know if you run into any trouble with this.