# Parametric subflow

**URL:** <https://discourse.nodered.org/t/parametric-subflow/97936>\
**Category:** General\
**Created:** [3 July 2025 14:23 UTC](https://discourse.nodered.org/t/parametric-subflow/97936 "2025-07-03T14:23:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mauzil](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mauzil/32/101490_2.png) [@mauzil](https://discourse.nodered.org/u/mauzil)\
**Post date:** [3 July 2025 14:23 UTC](https://discourse.nodered.org/t/parametric-subflow/97936/1 "2025-07-03T14:23:37Z")

</div>

Hi all.  
I'm new to NodeRED.

There is a way to define parameters for a subflow?

I'working with modbus server to simulate a machine.

I need to change a bit value in a word.  
This is the path for emergency.  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/c/4cedece2d4eae9612ff1aaba166c5827f1738f04.png)

Emergency is bit 0 of word at address 8000.

I need to add Emergency2 which is placed on bit 1 of word at address 8000  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/6/764098a1a20fe63e40e07ddd7ab98633bab1066c.png)

So i'd like to implement a subflow with one input pin and 2 property: address and bit\_pos

This the properties of subflow ChangeBit.

The property **address** should placed in address property of " **Modbus Getter**" and " **Modbus Write**"  
The property **bit** should be used in **change\_bit** function.

How can I refer to address subflow property inside a block of the subflow?

Sorry for my english.

Best regards  
Mauro

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [3 July 2025 15:16 UTC](https://discourse.nodered.org/t/parametric-subflow/97936/2 "2025-07-03T15:16:58Z")

</div>

You can do this with "environment" variables in the subflow settings. Open the subflow and click on "Edit properties" to define the required/optional variables:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/3/0329ac96f98ea5002b2cc4b855c1d7d1aa82f88e.png)

And then in the Editor panel for an instance of the subflow, you can set the values for that instance:

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

---

<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:** [1 October 2025 15:17 UTC](https://discourse.nodered.org/t/parametric-subflow/97936/3 "2025-10-01T15:17:01Z")

</div>

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