In all my flows I have one node with a context variable. Everything else is msg, with very few global variables.
From the documentation and fro previous forum posts, I understand that I should be able to see the content of this context variable by looking at the node with the context sidebar open.
But when I try it, there's nothing in the sidebar. I click on the node and nothing appears in the sidebar. I click on the node and click refresh, nothing appears. If I run the node, the context variable is definitely stored, but i can't see where to see it.
var inflightProcesses = context.get("inflightProcesses")
That "inflightProcesses" is an array. I check in it to see if a new process matches an existing one, then I add the new process to the array and set the new array back into the variable. The size of the array never gets bigger than 20. (I add the new element to the array with array.push(newElement) and use shift to delete the oldest element)
Then show the code in the function node, in a copyable format. I think your function may be writing then deleting it.
As the get.context will return undefined, then when you set.context to undefined, the context var would be deleted, ie. undefined.
[edit] add context.set("test", "test") to the start of your function, then run the function and then check the context store in the sidebar.
At various stages I've added node.warn in the code at the top and bottom. The data is most definitely in the variable.
The context variable is a 20 element array that is used, in that node, to store the last 20 processes through the node. There's old data in the variable. It just doesn't show in the sidebar.