By default nodered stores context in memory, this behaviour can be changed in settings.js, so context survives the software restarts or system reboots. Check the docs for that.
[{"id":"423cc4ff.dbf75c","type":"server-state-changed","z":"5db76bc2.b15b94","name":"","server":"d5ce5cec.92bc8","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"input_boolean.useless_switch","entityidfiltertype":"exact","outputinitially":false,"state_type":"habool","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"x":900,"y":420,"wires":[["c5cf4235.6086d","892510e2.52bc1"]]},{"id":"c5cf4235.6086d","type":"change","z":"5db76bc2.b15b94","name":"","rules":[{"t":"set","p":"useless_switch_2","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1210,"y":460,"wires":[[]]},{"id":"892510e2.52bc1","type":"function","z":"5db76bc2.b15b94","name":"","func":"flow.set('useless_switch_1',msg.payload)\nreturn msg;","outputs":1,"noerr":0,"x":1180,"y":400,"wires":[["40ba1f59.74ee3"]]},{"id":"e20c5fe2.451ff","type":"status","z":"5db76bc2.b15b94","name":"","scope":["40ba1f59.74ee3"],"x":800,"y":560,"wires":[["f3c0fede.94b3b"]]},{"id":"40ba1f59.74ee3","type":"function","z":"5db76bc2.b15b94","name":"status","func":"node.status({text:\"Just text status\"});\nreturn msg;","outputs":1,"noerr":0,"x":1310,"y":400,"wires":[[]]},{"id":"f3c0fede.94b3b","type":"debug","z":"5db76bc2.b15b94","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":970,"y":560,"wires":[]},{"id":"d5ce5cec.92bc8","type":"server","z":"","name":"Home Assistant","legacy":false,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true}]
If you refer to a variable in node-red triggering to start a flow on change that’s not possible. That’s why the homeassistant nodes are for, but something similar can be achieved with status (node.status in function). Check also the example above, if you want to reach another tab then use link-in link-out nodes or same status node.