# How to pass flow context into subflow environment variable

**URL:** <https://discourse.nodered.org/t/how-to-pass-flow-context-into-subflow-environment-variable/88029>\
**Category:** General\
**Created:** [16 May 2024 16:53 UTC](https://discourse.nodered.org/t/how-to-pass-flow-context-into-subflow-environment-variable/88029 "2024-05-16T16:53:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![cryogenicminer](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cryogenicminer/32/71546_2.png) [@cryogenicminer](https://discourse.nodered.org/u/cryogenicminer)\
**Post date:** [16 May 2024 16:53 UTC](https://discourse.nodered.org/t/how-to-pass-flow-context-into-subflow-environment-variable/88029/1 "2024-05-16T16:53:20Z")

</div>

I have a value saved in the flow context. flow.secret = "mysecret1234". I want to pass this into a subflow environment variable $secret via the config panel. How do I do this?

Thank you

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [16 May 2024 16:59 UTC](https://discourse.nodered.org/t/how-to-pass-flow-context-into-subflow-environment-variable/88029/2 "2024-05-16T16:59:56Z")

</div>

You cannot. The env vars of a subflow are static/fixed to the value you enter when you create the instance. This is by design.

If you want to pass data into the subflow, attach it to the msg using a change node or function node.

---

<div class="post-metadata">

**Author:** ![cryogenicminer](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cryogenicminer/32/71546_2.png) [@cryogenicminer](https://discourse.nodered.org/u/cryogenicminer)\
**Post date:** [16 May 2024 19:34 UTC](https://discourse.nodered.org/t/how-to-pass-flow-context-into-subflow-environment-variable/88029/3 "2024-05-16T19:34:04Z")

</div>

Ahh, Ok. Thank you.

---

<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:** [30 May 2024 19:34 UTC](https://discourse.nodered.org/t/how-to-pass-flow-context-into-subflow-environment-variable/88029/4 "2024-05-30T19:34:35Z")

</div>

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