Here is the breakdown on how the persistant context is stored,
-
Global: all global context is stored in a single JSON file, so if you have 4 tabs in your flow each creating a global item, they will all be stored in the 'global' folder in a single file called 'global.json'
-
Flow: all flow content on a
tab
is stored in in a single JSON file.The file's name is 'flow.json' and it is stored in a folder that has the ID of the flow
-
Context: all context content for a single
node
is stored in in a single JSON file.
The file's name is the ID of the node and the extension is 'json'.
It is stored in a folder that has the ID of the flow.
Here is what the flow.json
contains in these examples:
Bottom line - you would need to save each context item as an object that contained a value AND a timestamp. Then in a flow in your project, you would need to parse thru each of the context items to check it's timestamp and then delete that context item.
While you could edit the file itself and remove the items, you would have to stop Node-RED, edit the file and then start Node-RED again.