How to save and load flow Context Data


I'm working on a project in which the user configures a dashboard basically by modifying different objects and arrays. When I close and open Node-RED I want these variables to remain the same as when closed. I've been doing some research and to my understand this is currently only possible by exporting a json file before the program is closed and load it once the program again is started. Can anyone confirm this? And if so, possibly provide an example or explain how this can be done in more detail? I would be really appreciated. Thanks in advance!

Sounds like you are looking for context. See documentation.

Thank you. I've tried to paste the following inside the setting.js file:

When I close and open Node-RED it does not however look like the context data is loaded:
Skærmbillede 2022-11-15 232048

Do I have to do anything special in order to load the data to Node-RED? I thought they'd be loaded automatically if they were stored.

The documentation contains a lot of words explaining context. Read what you have pasted.
Note that all the settings were already in the settings file, you just needed to uncomment it, but i digress.

You have to restart node-red, not just close and open the browser window.

I wrote this (quite) awhile ago but it might help you understand a bit more about context data:

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.