Accessing Flow Variables in Python (and R) Snippet


How could one access the flow variables in Python Snippet module?  


I'm using Knime 2.5.2  (on Win7 64bit), with:

- KNIME Ptyhon Scripting extension

- KNIME Python Scripting

The plugin is running off of local python (2.7.2) installation.


Thank you in advance.



I also couldn't figure out how to access flow variable in R Snippet module.  Is there a way in R as well?  Thanks!


for the Python scripting extension and the R scripting extension (from the community contributions) you can access flowvariable with this placeholder:


If it contains a string, the statement has to be surrounded by quotes.

Let me know if it works.

But be aware: This is not the case for nodes from KNIME Python Scripting

Thank you very much!  It works very well with Python (flow variable is named abc):

import sys
pyOut = kIn     # both are assumed to be dictionaries


I wasn't so successful in using Rsnippet (community version), so I will stick to the default R Snippet:


Thanks for your feedback. Can you write down the code you tried in R?

Yes, I've tried the following code just to see if it works in the community version of R:

# throws: ERROR	 R Snippet	 Execute failed: voidEval failed, request status: error code: 127

x <- FLOWVAR(abc)
rOut <- rIn


In the default R snippet, here is what was used:

#would not write to KNIME console



The input table was

col1 col2
123 456


And flow variable was

int abc = 345

generated by TableCreator-->TableRowToVariable nodes

much too late of course, but the correct script for the R snippet should be:

x <- FLOWVAR(abc)
rOut <- kIn

the table which is sent to R is named "kIn"! this should solve the problem.