Some great ideas here in this thread, but I think we are overcomplicating stuff. I just want my dashboard to keep its state when Node-RED restarts for whatever reason, that simple.
In my opinion losing dashboard state on reboot is essentially data loss. I want my NR to be as robust as possible: that's why I set up filesystem storage for flow contexts and use node-red-contrib-stoptimer-varidelay instead of the built-in timer nodes, because those can also save their state and scheduled firing time. And most other software, e.g. browsers, can be closed and can reconstruct their state next time they are opened (re-open tabs, remember movie position and continue from there, whatever). I think this is a really elementary feature of any software, and from this point-of-view NR Dashboard not keeping its state is just weird.
See also sablier, which is an extreme example, but brings the point across about why I think proper persistence is important.
And I'm not doing this because I restart my Node-RED frequently for fun, but because I want to simply make my setup robust and resilient against e.g. power outages, which happen here quite frequently (a little bit of wind can cause outages lasting 1-2 hours).
Also in my case the dashboard is the single source of truth. Interacting with it can only send requests to the other service, and no external request is received by NR, nor is the target service used by anything else. It's one-way communication. This is why I don't want or need any data flow in the other direction (polling or handling incoming requests, etc.), that would make the whole setup much more complicated than it needs to be.
Right now my dashboard saves its state thanks to node-red-contrib-persist, so basically it is perfect. I just wish this feature was built-in, so I could omit wiring up all these persist in and out nodes.
Regarding MQTT: I'm using it for my home automation stuff, but on the system I'm hosting this dashboard there is no MQTT server and I don't see the need for it. Retained messages would basically do the same as node-red-contrib-persist, but with an external dependency that also needs to run.