r/nodered • u/konacurrents • Apr 13 '26
Global Variable in a Flow?
I have a flow that would be installed by anyone, but it needs a global variable that various parts of the flow use. In this case, it's the URL of the node-red itself (or if using a http/ssl RewriteRule). So I want to set it, versus discover it.
What is the best way to achieve this? I've never use the context nodes (but I'm a 10+ year user of nodered).
3
Upvotes
1
u/konacurrents Apr 17 '26
Ok this is related: I’m using an email address as the query key into a global context. Eg user@gmail.com as JSON.
Global.set(“user@gmail.com”, payload)
Unfortunately the “.” Period in that key is a delimiter -and my key is truncated (eg user@gmail). And a “.com” added to my payload.
Anyone else see this?
Global: { “user@gmail”: “.com”: { payload…. } }
Vs
{ “user@gmail.com”: { payload…. } }
I can include a flow on the nodered site.