# Add ability to \*require\* subflow env variable before deploy (like real nodes)

**URL:** <https://discourse.nodered.org/t/add-ability-to-require-subflow-env-variable-before-deploy-like-real-nodes/56922>\
**Category:** Feature Requests\
**Created:** [19 January 2022 15:36 UTC](https://discourse.nodered.org/t/add-ability-to-require-subflow-env-variable-before-deploy-like-real-nodes/56922 "2022-01-19T15:36:16Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![gemini86](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gemini86/32/70967_2.png) [@gemini86](https://discourse.nodered.org/u/gemini86)\
**Post date:** [19 January 2022 15:36 UTC](https://discourse.nodered.org/t/add-ability-to-require-subflow-env-variable-before-deploy-like-real-nodes/56922/1 "2022-01-19T15:36:16Z")

</div>

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/7/77f671b0bda68ec979160d765447a81c213f541c.png)

Just a simple checkbox under each env property in properties editor, which when checked, would require these fields not be left empty before deploying.

For now my workaround is checking for these fields to be filled in and throwing an node.error when they're empty, but this could be avoided if the flows were never allowed to be deployed with the subflow config in an error state.

EDIT: updated image for clarification- sorry I didn't spend enough time to align the label correctly.

---

<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:** [19 January 2022 15:50 UTC](https://discourse.nodered.org/t/add-ability-to-require-subflow-env-variable-before-deploy-like-real-nodes/56922/2 "2022-01-19T15:50:25Z")

</div>

To be clear, we never prevent a deploy, but will warn the user there are misconfigured nodes.

Adding validation options to the subflow properties would be a useful feature. Have added to the backlog.

https://trello.com/c/AdaiRwkl.html

---

<div class="post-metadata">

**Author:** ![gemini86](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gemini86/32/70967_2.png) [@gemini86](https://discourse.nodered.org/u/gemini86)\
**Post date:** [19 January 2022 15:55 UTC](https://discourse.nodered.org/t/add-ability-to-require-subflow-env-variable-before-deploy-like-real-nodes/56922/3 "2022-01-19T15:55:21Z")

</div>

Yes sorry for the the muddy wording- do not prevent a deploy but notify the user of an error before deploy. 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:** [20 March 2022 15:56 UTC](https://discourse.nodered.org/t/add-ability-to-require-subflow-env-variable-before-deploy-like-real-nodes/56922/4 "2022-03-20T15:56:19Z")

</div>

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