# Context variables in Python3 function node?

**URL:** <https://discourse.nodered.org/t/context-variables-in-python3-function-node/10994>\
**Category:** General\
**Created:** [10 May 2019 11:22 UTC](https://discourse.nodered.org/t/context-variables-in-python3-function-node/10994 "2019-05-10T11:22:41Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![xoani](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/xoani/32/7844_2.png) [@xoani](https://discourse.nodered.org/u/xoani)\
**Post date:** [10 May 2019 11:22 UTC](https://discourse.nodered.org/t/context-variables-in-python3-function-node/10994/1 "2019-05-10T11:22:41Z")

</div>

Hello.  
I am trying to store values in a flow variable and call it in the next function node. The problem is that I am using Python3 function nodes and I don't know how to work with flow variables in python. Can anyone show me an example?

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [10 May 2019 11:27 UTC](https://discourse.nodered.org/t/context-variables-in-python3-function-node/10994/2 "2019-05-10T11:27:07Z")

</div>

if you search this forum for “python context” you will find this thread where the question was asked previously

> [@Flow variables "set" and "get" in python3 node](https://discourse.nodered.org/t/flow-variables-set-and-get-in-python3-node/4082):
>
> Hi guys, I am trying to use the "context.get()" and "context.set()" in python3 function node and I am getting below error. global name 'context' is not defined. your kind help is much appreciated. Thanks.

---

<div class="post-metadata">

**Author:** ![xoani](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/xoani/32/7844_2.png) [@xoani](https://discourse.nodered.org/u/xoani)\
**Post date:** [10 May 2019 11:30 UTC](https://discourse.nodered.org/t/context-variables-in-python3-function-node/10994/3 "2019-05-10T11:30:41Z")

</div>

HI. I see the question but there isn't any solution (I think)

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [10 May 2019 11:36 UTC](https://discourse.nodered.org/t/context-variables-in-python3-function-node/10994/4 "2019-05-10T11:36:54Z")

</div>

“You could try raising an issue, but otherwise, not much else we can do for you.”

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [10 May 2019 12:30 UTC](https://discourse.nodered.org/t/context-variables-in-python3-function-node/10994/5 "2019-05-10T12:30:31Z")

</div>

You could pass the values as command line parameters to the python script

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [10 May 2019 13:07 UTC](https://discourse.nodered.org/t/context-variables-in-python3-function-node/10994/6 "2019-05-10T13:07:04Z")

</div>

Or possibly do it all in node-red instead.
