Workflow variable


I have declared a workflow variable "path" with value "D:\Knime\data\" and want to use it in XLS reader node. Because I don’t want to change the file path in every node. Please let me know how we could do this.

Thanks in advance.


Rakhi Pramanik



You will need to create a flow variable with the full filepath of the file you are reading to pass into the XLS reader node.

Thanks for quick reply. Actually I want to execute my workflow from cmd with some parameter and for that reason I want to implement the "Workflow variable" in our workflow. It will be helpful for me if you give some idea or example about the uses of "Workflow variable."

Thanks in advance.

Rakhi Pramanik



Are you planning on providing the full path to the file in your command or will you need the workflow to determine this? 

There are some examples of how to use flow variables in the public workflow server. See 011_FlowVarsAndLoops and then 011005)loopColumnsWriteCsv for example. 

You can find some info on calling from the command line here: 



Thanks Sam.

I will check.



I want to add my workflow as part of regression tests hence I will use command line. Since the database URL will change with each run depending on which machine it runs on, I created a workflow variable. Now, in the workflow itself how do I use this workflow variable in my Database Table Connector Node?


It would have been better to have this question posted to a new thread, anyway here is how to do it:

1. Feed the workflow variable into the Database Table Connector node. To do this, you first need to right click on the node and select Show Flow Variable Ports. This will display one red dot on each side of the node. The left red dot is the flow variable input port and is where you need to feed in your input flow variable with the name URL of the database (let's assume the flow variable is named DB_URL)

2. Open the configuration window of the Database Table Connector node and go to the second tab named Flow Variables.

3. Look for the 4th entry called "database", then open the dropdown box next to it and choose from it your input flow variable DB_URL. If your flow variable doesn't appear among those in the drop-down box it means it is not properly received by the node (did you connect it?) or its data type doesn't match the expected one for this parameter.

4. Go back to the first tab in the configuration dialogue and confirm that at the bottom of the window it says ' The "database" variable is controlled by a variable '.

5. You are done. Now your Database Table Connector node is using the content of the flow variable DB_URL as Database url.