I have a function node where I use the context to save the information of several incoming messages.
But I figured that the context lives, still after the flow restartet. Is there an elegant way of doing that?
Here is what I am trying to do:
var local= context.get('data') || ; local.push(msg.parts.index); msg.downloadIndex = local; context.set('data', local); return msg;
After the first run:
msg.downloadIndex = [0,1]
After the second run:
msg.downloadIndex = [0,1,0,1]
After the third run:
msg.downloadIndex = [0,1,0,1,0,1]
... I think you get it.
I want that
msg.downloadIndex always looks like the first run, after a run.
I hope my question makes sense.