Alas it is not a simple thing.
This started with me playing with a subflow and weather.
I have a lot of code/nodes to create a message which determines the icon to show.
It was working but I was/am a long way from completing it fully.
Though I hope to never have to include tsunami as an icon to be shown.
But things like fog, snow, hail and maybe a couple of others weren't applicable and so they were never implemented.
snow snuck up on me.
The external code indicated the subflow didn't find the correct icon.
(That's a whole other story)
Anyway, somehow it started to work.
But in my fixing that, other problems suddenly started to happen. How? Why? Dunno.
So I got bogged down in looking at the subflow while sending real data into it. I since have deduced that a tab with a subflow's contents is NOT dynamic and so can't be watched in real time.
So I had to take all the subflow back out of there and put it in the main tab. (Oh the fun finding the space)
But I then had to change all the parent flow context access back to this level.
That is about when I realised there is a problem with how I was doing that.
I simply had
flow.get($name) rather than
But in finding that out, it opened a can of worms between what I had noted on how to do it and what is now documented.
Yes, my fault for not keeping up with the new docs.
I then got all the parent flow context stuff worked out. All was good - I hoped.
But then something else popped up and so I started this thread - from memory.
I was told to not use context from the parent flow in subflows.
And after a bit of sitting and thinking (well: a lot) I decided to take that on and send the message into the subflow to completely get around the problem.
But I was wanting to get definitive confirmation of the syntax so I can update my notes.
SO....???? What now?
So now, most of the problem is gone, but it kind of has raised another question which is/was teetering on being asked:
If it is bad programming to access context from the parent flow: why is it supported?
To me if the first statement is true, allowing context access to/of the parent flow is only promoting bad programming practice.