I just found this post:
https://discourse.nodered.org/t/persistent-context-storage/37858/2
by setting
contextStorage: {
default: {
module: 'memory'
},
disk: {
module: 'localfilesystem', config: {flushInterval: '600'},
},
},
I can keep it all in memory, but flush to disk at the end of every cycle with:
flow.set("my_object", content, "disk")
That will do the trick