# ❓ DISCUSSION: Should nodes save/restore their own context?

**URL:** <https://discourse.nodered.org/t/discussion-should-nodes-save-restore-their-own-context/20590>\
**Category:** General\
**Created:** [19 January 2020 19:16 UTC](https://discourse.nodered.org/t/discussion-should-nodes-save-restore-their-own-context/20590 "2020-01-19T19:16:08Z")\
**Posts on this page:** 1\
**Showing post:** 79

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [25 January 2020 19:57 UTC](https://discourse.nodered.org/t/discussion-should-nodes-save-restore-their-own-context/20590/79 "2020-01-25T19:57:02Z")

</div>

`node-red-contrib-ui-state-trail` has now been updated to restore it's chart data after a full deploy, node-RED restart or system reboot. I've just been trying it and it works great, thanks @hotNipi.  
The changes implemented have also moved development potential further forward, as the node now has access to the node-RED's `setting.js` file, and therefore it's `contextStorage` settings, so rules have be introduced to ensure that Data Storage is only implemented whenever a persistent data store is available.

Knowing which storage modules are available, opens up the future potential to maybe being able to select different storage option from within the node config (as @TotallyInformation commented above), and also ensure that orphaned data is cleaned up if a different storage option is selected.  
Also as commented above, edge cases also need to be managed, but hopefully the clever guys here will eventually build this into a viable model for node data persistence.

---

_[View the full topic](https://discourse.nodered.org/t/discussion-should-nodes-save-restore-their-own-context/20590)._
