Just a question as both appear to work. What is the recommended way of setting a variable?
Should I use the flow.set('myVariable') or does context.flow.myvariable work.
Just trying to understand the correct and supported method to use.
And yes, I am just working with flow specific and not global.
flow.set will use the context storage api... If you set up other types of context storage then they will work correctly. - Using context.flow.myvariable will write direct to in memory context - thus bypassing the storage api - so may not end up in external storage, (if that is what you had configured), and thus survive a restart. Also it won't be reflected in the context sidebar view correctly. So ideally you should use .set - but if you only use in memory context then flow.context should work.