Best way to save variables across node-red restarts?

In the past, others have suggested using an MQTT broker (i.e. mosquito) that supports "retained messages" -- so when an mqtt in node connects to a topic it receives the last message that was sent to that topic.

I have not tried this myself, but it sounds pretty elegant and bullet-proof. Searching this forum for "mqtt retain context" yields many interesting threads, like this one: Access to mqtt retained messages

Edit: in my pre-caffeine state, I failed to notice the category is "Developing Nodes" -- so this is probably not relevant to what you are doing