# NR Conundrum sett flow context changes global context

**URL:** <https://discourse.nodered.org/t/nr-conundrum-sett-flow-context-changes-global-context/68955>\
**Category:** General\
**Created:** [12 October 2022 23:00 UTC](https://discourse.nodered.org/t/nr-conundrum-sett-flow-context-changes-global-context/68955 "2022-10-12T23:00:51Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [12 October 2022 23:24 UTC](https://discourse.nodered.org/t/nr-conundrum-sett-flow-context-changes-global-context/68955/2 "2022-10-12T23:24:46Z")

</div>

Javascript store object by reference.  
So setting flow to a variable sets the variable to reference the same memory. If you then alter either the other will reference the new value.

you will need to clone it using RED.util.cloneMessage(flow.get("string"))

> **[Cloning messages in a flow](https://nodered.org/blog/2019/09/13/cloning-messages)**
>
> With the move to asynchronous messaging, we're also changing how the Function node clones messages. Find out what cloning is all about, why it's necessary and what's changing in 1.0.

> **[Object references and copying](https://javascript.info/object-copy)**

---

_[View the full topic](https://discourse.nodered.org/t/nr-conundrum-sett-flow-context-changes-global-context/68955)._
