# Nested flows with secrets, passing variables to nested sub-flow

**URL:** <https://discourse.nodered.org/t/nested-flows-with-secrets-passing-variables-to-nested-sub-flow/44129>\
**Category:** General\
**Created:** [13 April 2021 20:43 UTC](https://discourse.nodered.org/t/nested-flows-with-secrets-passing-variables-to-nested-sub-flow/44129 "2021-04-13T20:43:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![GrahamW](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/grahamw/32/40261_2.png) [@GrahamW](https://discourse.nodered.org/u/GrahamW)\
**Post date:** [13 April 2021 20:43 UTC](https://discourse.nodered.org/t/nested-flows-with-secrets-passing-variables-to-nested-sub-flow/44129/1 "2021-04-13T20:43:00Z")

</div>

TL;DR how to I pass variables from one sub-flow to a child sub-flow?

I am using a flow that already uses sub-flows; secrets and other config are passed to the sub-flows via environment variables (using the config panel.)

I want to be able to deploy this in different environments, so different secrets are required.

My initial thought was to take the entire flow, and extract that as a sub-flow to have all the variables and secrets defined in one place. However I don't know how to pass those variables through the the sub-flows.

Apologies if this doesn't make much sense. Any help would be greatly appreciated.

---

<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:** [12 June 2021 20:43 UTC](https://discourse.nodered.org/t/nested-flows-with-secrets-passing-variables-to-nested-sub-flow/44129/2 "2021-06-12T20:43:48Z")

</div>

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