# Subflow context (flow)

**URL:** <https://discourse.nodered.org/t/subflow-context-flow/11534>\
**Category:** General\
**Created:** [25 May 2019 11:21 UTC](https://discourse.nodered.org/t/subflow-context-flow/11534 "2019-05-25T11:21:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [25 May 2019 11:21 UTC](https://discourse.nodered.org/t/subflow-context-flow/11534/1 "2019-05-25T11:21:01Z")

</div>

From what I have found a sub-flow can't see `flow.set("variables")`

I would just like to confirm this as I am having a lot of fun chasing a problem now I am using sub-flows.

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [25 May 2019 11:37 UTC](https://discourse.nodered.org/t/subflow-context-flow/11534/2 "2019-05-25T11:37:01Z")

</div>

The nodes in a subflow can use flow context, bit it is scoped to the nodes in the subflow, not the flow the instance of the subflow is on.

If you are on 0.20, then the nodes in the subflow can access the parent flow context. If you have a flow context variable called `foo` then the nodes in a subflow can use `$parent.foo` to access it.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [25 May 2019 11:44 UTC](https://discourse.nodered.org/t/subflow-context-flow/11534/3 "2019-05-25T11:44:48Z")

</div>

{{HUGS}}

Thanks.

Alas ITMT I have bashed out a "work around" which is now being used. But noted!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [9 October 2023 08:22 UTC](https://discourse.nodered.org/t/subflow-context-flow/11534/4 "2023-10-09T08:22:47Z")

</div>

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