# delete flow variable

**URL:** <https://forum.knime.com/t/delete-flow-variable/6641>\
**Category:** KNIME Analytics Platform\
**Created:** [September 12, 2014, 11:37am UTC](https://forum.knime.com/t/delete-flow-variable/6641 "2014-09-12T11:37:30Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![darbon](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/d/67e7ee/32.png) [@darbon](https://forum.knime.com/u/darbon)\
**Post date:** [September 12, 2014, 11:37am UTC](https://forum.knime.com/t/delete-flow-variable/6641/1 "2014-09-12T11:37:30Z")

</div>

Hi,

Is there a method to delete a flow variable?

Thanks

---

<div class="post-metadata">

**Author:** ![thor](https://forum-cdn.knime.com/user_avatar/forum.knime.com/thor/32/4_2.png) [@thor](https://forum.knime.com/u/thor)\
**Post date:** [September 12, 2014, 2:10pm UTC](https://forum.knime.com/t/delete-flow-variable/6641/2 "2014-09-12T14:10:30Z")

</div>

No, flow variables cannot be deleted.

---

<div class="post-metadata">

**Author:** ![aborthwick](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/a/3ab097/32.png) [@aborthwick](https://forum.knime.com/u/aborthwick)\
**Post date:** [July 22, 2015, 12:52am UTC](https://forum.knime.com/t/delete-flow-variable/6641/3 "2015-07-22T00:52:11Z")

</div>

I just wanted to comment that this is pretty annoying. &nbsp;I have a large workflow and just hit a bug where a "Java Edit Variable" node was assuming that a flow variable was new. &nbsp;But then I created a variable far upstream with the same name. &nbsp;Now that node crashes. &nbsp;It would have been much better if I could have deleted that flow variable upstream after I was done using it.

---

<div class="post-metadata">

**Author:** ![dnaki](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/d/a8b319/32.png) [@dnaki](https://forum.knime.com/u/dnaki)\
**Post date:** [July 22, 2015, 11:56pm UTC](https://forum.knime.com/t/delete-flow-variable/6641/4 "2015-07-22T23:56:59Z")

</div>

Hi aborthwick,

Yes, I encounter this often when I create metanodes that are used several times throughout the workflow.

You may have figured this out already, but the workaround I use whenever I create a new variable with a Java Snippet node that might be used multiple times in a workflow is to&nbsp;precede the JS node with a Java Edit Variable node. The Java Edit Var node should be configured to create a new variable of the same type and name of the variable in the Java Snippet node. Connect the Java Edit Var node to the left "mickey mouse ear" i.e. flow variable inport of the Java Snippet node. Now when you add the&nbsp;same named output variable in the Java Snippet node it should be configured to replace the already existing variable instead of create a new variable. This prevents you from getting&nbsp;the error about the JS node trying to create a new variable that already exists.

One more point... apparently the "Sub Node" feature (which as similar to the Meta Node feature) will prevent variables from leaking from the contained nodes. There isn't much documentation yet but I understand from KNIME folks that more support is coming and eventually sub nodes will be preferred to meta nodes.

Hope this helps.

Don

---

<div class="post-metadata">

**Author:** ![aborthwick](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/a/3ab097/32.png) [@aborthwick](https://forum.knime.com/u/aborthwick)\
**Post date:** [July 29, 2015, 1:10am UTC](https://forum.knime.com/t/delete-flow-variable/6641/5 "2015-07-29T01:10:33Z")

</div>

Hi Don,

Thanks for your reply. &nbsp;I would use the Sub Node feature in order to prevent variable leakage, but the problem is that a Meta Node is configurable whereas a Sub Node can't be configured. &nbsp;In general, most of my Meta Nodes have configuration parameters. &nbsp;

Hopefully this is fixed in the next release of Sub Nodes.

Andrew

---

<div class="post-metadata">

**Author:** ![knot](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/k/ed8c4c/32.png) [@knot](https://forum.knime.com/u/knot)\
**Post date:** [November 28, 2016, 10:28am UTC](https://forum.knime.com/t/delete-flow-variable/6641/6 "2016-11-28T10:28:19Z")

</div>

I'm curious. Why is there no way to delete flow variables? And by "delete" I mean "make inaccessible for downstream nodes".

Right now I have a growing number of flow variables. It would be nice to have something like the Column Filter node but for flow variables, so that I will only see the variables that I think I need for further downstream processing.

---

<div class="post-metadata">

**Author:** ![Iris](https://forum-cdn.knime.com/user_avatar/forum.knime.com/iris/32/14_2.png) [@Iris](https://forum.knime.com/u/Iris)\
**Post date:** [December 2, 2016, 3:16pm UTC](https://forum.knime.com/t/delete-flow-variable/6641/7 "2016-12-02T15:16:01Z")

</div>

Maybe I ask the opposite question. Why is it necessary to delete flow variables? Honestly I never had the feeling I need to delete them. They are just there.

&nbsp;

If you don't like them, you could also put the functionality inside a wrapped node. Flow variables created inside a wrapped node are not available outside of the node (if you don't want them to be)

---

<div class="post-metadata">

**Author:** ![David\_Ko](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/d/f9ae1b/32.png) [@David\_Ko](https://forum.knime.com/u/David_Ko)\
**Post date:** [December 2, 2016, 8:56pm UTC](https://forum.knime.com/t/delete-flow-variable/6641/8 "2016-12-02T20:56:42Z")

</div>

I use a wrapped node, which protects the scope of any flow variables within it, and use quickform nodes to provide configuration options. These allows for parameters and selections of input table values.&nbsp;

I have found that with this any corruption of flow variable from different parts of the workflows can be prevented. I also use call local workflow node to create&nbsp;factories so I can have a generic workflow that passes control&nbsp;to local workflows to deal with anything specific. This keeps the scope of the flow variables precise to where it is needed.&nbsp;

David

&nbsp;

---

<div class="post-metadata">

**Author:** ![knot](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/k/ed8c4c/32.png) [@knot](https://forum.knime.com/u/knot)\
**Post date:** [December 7, 2016, 3:52pm UTC](https://forum.knime.com/t/delete-flow-variable/6641/9 "2016-12-07T15:52:40Z")

</div>

It is not strictly necessary to delete them. But it would be nice if that were possible.

I am working on a fairly large workflow and there are many variables that are only specific to certain parts of the workflow but they still show up in the setup for nodes that are further downstream.

Certainly, wrapped nodes/metanodes can help, but they don't always provide what I want. Sometimes I want to export a specific variable from a metanode while discarding all other variables. I don't think this currently possible.

For me it is mostly an issue of having a clean workspace while still being able to express myself with any variables that I would need to describe what I want to influence. In most programming languages you also have local and global variables that you can use to give names to intermediate or permanent values. And the local variables are always gone after a function returns.

---

<div class="post-metadata">

**Author:** ![Fabien\_Couprie](https://forum-cdn.knime.com/user_avatar/forum.knime.com/fabien_couprie/32/4418_2.png) [@Fabien\_Couprie](https://forum.knime.com/u/Fabien_Couprie)\
**Post date:** [December 20, 2017, 5:21pm UTC](https://forum.knime.com/t/delete-flow-variable/6641/10 "2017-12-20T17:21:16Z")

</div>

Hi, it could be necessary in some situations. For example, if I use the extract context properties node, it creates incompatibility with the Python nodes that throw the error "Requested string value from cell with type: STRING".

So if I use the David Ko trick wrapping the extract context properties and keep only the variable I need from context and rename it the error disapear.

Fabien

---

<div class="post-metadata">

**Author:** ![baarzo](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/b/e99b99/32.png) [@baarzo](https://forum.knime.com/u/baarzo)\
**Post date:** [May 4, 2018, 1:18pm UTC](https://forum.knime.com/t/delete-flow-variable/6641/11 "2018-05-04T13:18:54Z")

</div>

I have the same problem merging two different workflow I have problem with flow variable with the same name, a node that permits to delete or rename a folw variable it will be very usefull

---

<div class="post-metadata">

**Author:** ![Patrick1974](https://forum-cdn.knime.com/user_avatar/forum.knime.com/patrick1974/32/996_2.png) [@Patrick1974](https://forum.knime.com/u/Patrick1974)\
**Post date:** [May 6, 2018, 11:23am UTC](https://forum.knime.com/t/delete-flow-variable/6641/12 "2018-05-06T11:23:48Z")

</div>

Hey @Iris,

I try having a more canonical view on that:  
A variable is defined by a name, a type and a visibility. “name” is the unique identifier within the “visibility”. “type” defines the range of valid values and allowed operations. “visibility” tells something about who is allowed to read/modify a variable (realm).

A variable from a realm may under no circumstances be accessible from another realm (security) - else wise the value is no more trustworthy and/or a security leak may arise.

From that point of view, a kind of “garbage collection” or “limited visibility” makes sense!

@aborthwick: A common approach to circumvent these situations is by using realm-bound prefixes (e.g., variables used during data load are prefixed “dl” while variable used within processing are prefixed “pc”).

Kind regards,

Patrick

---

<div class="post-metadata">

**Author:** ![MBoesing](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/m/f475e1/32.png) [@MBoesing](https://forum.knime.com/u/MBoesing)\
**Post date:** [June 15, 2018, 12:42pm UTC](https://forum.knime.com/t/delete-flow-variable/6641/13 "2018-06-15T12:42:45Z")

</div>

Hi @Iris,  
I would use wrapped metanodes for encapsulation flow variables.  
But, there is one usecase, which prevents using wrapped metanodes:  
I have hundreds of interactions with databases and I can’t using database nodes within wrapped metanodes, if I want to start my workflow as a scheduled workflow on knime server.  
The reason is, that I can not get the workflow-credentials into the wrapped metanode! The only way to do this, is to use quickforms for setting username/password. But this won’t work with scheduling…  
So I have to deal with all flow variables along the complete workflow…

Another thing is: I created some generic Nodes for our organisation which contains database-stuff. But with wrapped Metanodes we cannot use these (see above). And so, all colleges get flow-variables they won’t have…

---

<div class="post-metadata">

**Author:** ![mpenalver](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/m/b782af/32.png) [@mpenalver](https://forum.knime.com/u/mpenalver)\
**Post date:** [July 16, 2021, 9:40pm UTC](https://forum.knime.com/t/delete-flow-variable/6641/14 "2021-07-16T21:40:23Z")

</div>

I absolutely agree with the convenience of having a **Variable Filter** node.

---

<div class="post-metadata">

**Author:** ![ipazin](https://forum-cdn.knime.com/user_avatar/forum.knime.com/ipazin/32/806_2.png) [@ipazin](https://forum.knime.com/u/ipazin)\
**Post date:** [July 19, 2021, 10:33am UTC](https://forum.knime.com/t/delete-flow-variable/6641/15 "2021-07-19T10:33:09Z")

</div>

Hello @mpenalver,

your request has been noted. (Internal Reference: AP-16515)

Br,  
Ivan

---

<div class="post-metadata">

**Author:** ![iCFO](https://forum-cdn.knime.com/user_avatar/forum.knime.com/icfo/32/36036_2.png) [@iCFO](https://forum.knime.com/u/iCFO)\
**Post date:** [December 17, 2021, 3:09pm UTC](https://forum.knime.com/t/delete-flow-variable/6641/16 "2021-12-17T15:09:19Z")

</div>

The inability to filter flow variables really causes hassles in creating large workflows that have duplicate process components or node collections. It builds up a massive confusing backlog of flow variable clutter, it causes duplication of flow variables when reading and writing variables to memory, and in general it is just bad practice to leave a confusing mess of “single process use” flow variables in the larger workflow pool at risk of being used in error on a later date… I don’t get why anyone wouldn’t want the ability to filter variables? Is this still not possible?

---

<div class="post-metadata">

**Author:** ![Daniel\_Weikert](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/d/e47c2d/32.png) [@Daniel\_Weikert](https://forum.knime.com/u/Daniel_Weikert)\
**Post date:** [December 17, 2021, 4:13pm UTC](https://forum.knime.com/t/delete-flow-variable/6641/17 "2021-12-17T16:13:37Z")

</div>

I guess only “remove them completely” for parts of the workflow by using a component  
br

---

<div class="post-metadata">

**Author:** ![iCFO](https://forum-cdn.knime.com/user_avatar/forum.knime.com/icfo/32/36036_2.png) [@iCFO](https://forum.knime.com/u/iCFO)\
**Post date:** [December 17, 2021, 7:04pm UTC](https://forum.knime.com/t/delete-flow-variable/6641/18 "2021-12-17T19:04:20Z")

</div>

Components not passing flow variables does help, but the flow variables in a workflow that control large numbers of components can’t be wrapped in components…

---

<div class="post-metadata">

**Author:** ![iCFO](https://forum-cdn.knime.com/user_avatar/forum.knime.com/icfo/32/36036_2.png) [@iCFO](https://forum.knime.com/u/iCFO)\
**Post date:** [December 17, 2021, 8:48pm UTC](https://forum.knime.com/t/delete-flow-variable/6641/19 "2021-12-17T20:48:50Z")

</div>

This must be a relevant issue for a lot of users considering that it has 2800 views. 😉

---

<div class="post-metadata">

**Author:** ![ipazin](https://forum-cdn.knime.com/user_avatar/forum.knime.com/ipazin/32/806_2.png) [@ipazin](https://forum.knime.com/u/ipazin)\
**Post date:** [December 20, 2021, 3:30pm UTC](https://forum.knime.com/t/delete-flow-variable/6641/20 "2021-12-20T15:30:06Z")

</div>

Hello @iCFO,

> [@iCFO](#):
>
> Is this still not possible?

Nop. Have added +1 to existing ticket mentioned above.

> [@iCFO](#):
>
> This must be a relevant issue for a lot of users considering that it has 2800 views.

Although number of views is relevant topic is pretty old so might be a bit misleading…

Br,  
Ivan

[Next page](https://forum.knime.com/t/delete-flow-variable/6641.md?page=2)
