Accessing flow context from the subflow

Hello

I'm trying to package some of my flows into sub-flows to make it easier to follow.
One of my function nodes is going through the flow context store using:

flow.keys()

and delete some variables when they are not needed.
After packaging this into sub-flows this function stopped working.
I know that the parent variable can be accessed by using

flow.get('$parent.' + 'variable_name');

Is there any option to use keys() function and then to set specific $parent variables to undefined?

Basically, I need to retrieve a list of the parent flow variables to find ones that need deleting and delete them from the sub-flow level.

1 Like

Hi - good question. There is no way for a subflow to get the context keys of the parent flow. That scenario has not been considered in the api.

Hi.
Thank you for prompt response.
I thought that I do something wrong, now at least I know it's currently unavailable.
Do you know if this is planned to be included in the future releases?

Would it not be possible to build a kind of "interface" using existing nodes?

a) subflow sends a msg with a request to get a list of context keys -> parent flow responds back with list of context keys

b) subflow sends a msg with request to delete a specific key -> parent flow deletes key and responds with a confirmation

Nothing is planned. Until you mentioned it, it hasn't come up at all.

Is there any way of making official request?
How the decision is made on what is going on the new release?

I understand you can't just add stuff, because some random bloke on the internet is asking for it.

I've added to the backlog - https://trello.com/c/JILEMOQ5

It can be prioritised along with everything else.

1 Like

I don't see the reason why this wouldn't work, but in my case it's defeating the object of having a subflow.
Instead of making it simpler it will add complexity.

I will have to send request from the subflow and than inject the results back into input. As there is only one input to the subflow available I will have to manage the messages to get to the right part of the subflow. Alternatively I can have two subflows, but again this will make it more complex than it currently is with my function nodes.

Yes, I know, it was just a quick work-around idea but it depends on the urgency. If you have time to wait, then wait until this gets covered from the backlog

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.