I cannot figure out this one, looking for some help.
I define n8n.endpoint in a Set, and try to use it in an HTTP Request loop later on. However, the correct value is used in the first iteration, but it’s lost in the upcoming iterations.
This is my simplified workflow:
If I hardcode the URL on the HTTP Request node, it works just fine.
Information on your n8n setup
n8n version: 0.183.0
Database you’re using (default: SQLite): Postgres
Running n8n with the execution process [own(default), main]: main
Running n8n via [Docker, npm, n8n.cloud, desktop app]: Docker
Give the workflow below a bash, There was a change to the way you can get items from a node so you can use the old $items(“node name”) option or the experimental pairedItem option which is not yet available for all nodes.
For fun I have also used the new public API as that is less likely to change in the future.
Your suggestion worked. In short, on the HTTP Request loop I changed:
{{$node["Globals"].json["n8n"]["endpoint"]}}
to
{{$("Globals").pairedItem().json.n8n.endpoint}}
I was not familiar with this syntax, but it worked.
If it isn’t ask too much, @Jon, can you elaborate why the original option didn’t work in this case?
However, the correct value is used in the first iteration, but it’s lost in the upcoming iterations. If I hardcode the URL on the HTTP Request node, it works just fine.
Sounds like you might have run into the problem described over here, so you might need to add .first() into the mix here.
If you run into any trouble with this it’d be great if you could post a simplified example workflow using which your problem can be reproduced in a new thread.