# Subflows & Context

**URL:** https://discourse.nodered.org/t/subflows-context/65465
**Category:** General
**Created:** [22 July 2022 06:29 UTC](https://discourse.nodered.org/t/subflows-context/65465 "2022-07-22T06:29:34Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![mathias-ewald](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mathias-ewald/32/64611_2.png) [@mathias-ewald](https://discourse.nodered.org/u/mathias-ewald)
#### Post date: [22 July 2022 06:29 UTC](https://discourse.nodered.org/t/subflows-context/65465/1 "2022-07-22T06:29:34Z")

</div>

I am not sure I understand properly how contexts work for subflows. I read that the "flow" context for subflow nodes is NOT the one of the parent flow. Ok that makes sense. What I am not getting: As many flows use a specific subflow, does that create multiple instances of that subflow, hence multiple flow contexts or are all parent flows calling the same subflow and the flow context will always be the same. It's a tricky question to phrase, I hope it makes sense.

Example: I have a subflow that stored something in the flow context with a key named `foo`. When that subflow is use multiple times from different flows, will `foo` be overwritten everytime or does each subflow have its own `foo`?

cheers,  
Mathias

---

<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: [22 July 2022 06:39 UTC](https://discourse.nodered.org/t/subflows-context/65465/2 "2022-07-22T06:39:02Z")

</div>

> [@mathias-ewald](#):
>
> What I am not getting: As many flows use a specific subflow, does that create multiple instances of that subflow, hence multiple flow contexts or are all parent flows calling the same subflow and the flow context will always be the same. It's a tricky question to phrase, I hope it makes sense

Multiple instances with their own context.

---

<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: [5 August 2022 06:39 UTC](https://discourse.nodered.org/t/subflows-context/65465/3 "2022-08-05T06:39:56Z")

</div>

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