# Flow context doesnt work

**URL:** <https://discourse.nodered.org/t/flow-context-doesnt-work/72593>\
**Category:** General\
**Tags:** function-node\
**Created:** [22 December 2022 15:21 UTC](https://discourse.nodered.org/t/flow-context-doesnt-work/72593 "2022-12-22T15:21:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zac](https://avatars.discourse-cdn.com/v4/letter/z/87869e/32.png) [@Zac](https://discourse.nodered.org/u/Zac)\
**Post date:** [22 December 2022 15:21 UTC](https://discourse.nodered.org/t/flow-context-doesnt-work/72593/1 "2022-12-22T15:21:26Z")

</div>

Hey,

when I use in the function-Node the following:  
`flow.xyz = "test";`

and then try to get the value with the following in another function-Node:

`let a = flow.xyz;`

then my variable "a" is undefined?

But when I do the same with "context.flow.xyz" instead of just "flow.xyz" it works?

I thought and read in the docs that "context.flow" and just "flow" is the same?

Would appreciate any help and explanation!

---

<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 December 2022 15:38 UTC](https://discourse.nodered.org/t/flow-context-doesnt-work/72593/2 "2022-12-22T15:38:46Z")

</div>

Use the built in functions as described in the docs: [Writing Functions : Node-RED](https://nodered.org/docs/user-guide/writing-functions#storing-data)

Note, newer Node-RED has built-in "autocomplete" and macros too  
 ![chrome_YxactETQuJ](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/a/3ac39afff31e9c94b810b7ef42deb3edb78c409c.gif)

---

<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 January 2023 15:39 UTC](https://discourse.nodered.org/t/flow-context-doesnt-work/72593/3 "2023-01-05T15:39:23Z")

</div>

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