KNIME batch execution with several variables and R script nodes


In principle it is clear to me how to run KNIME in batch mode. The explanation can be found here:

What I would like to do is the following:

  • I would like to use more than one workflow variables. Do I need several option like -workflow.variable=my_integer,5,int
  • I have some interactive R scripting nodes in the workflow und a R installation for these R nodes. What do I need to consider to make such workflows executable in batch mode?
  • Can I run the zipped workflow several times in parallel?



Hi Frank,

Great that you spotted the FAQ help! Here are some answers to your remaining questions.

1. Multiple variables can be specified like: 
knime -nosplash -application org.knime.product.KNIME_BATCH_APPLICATION -workflowFile="" -workflow.variable=input_file,"in.csv",String -workflow.variable=output_file,"out.csv",String -reset -consoleLog -noexit

2. I believe that you just need to have R installed an configured correctly to run the workflow graphically. If you're using a non-standard path to the R executable you may need to export the preferences, and pass them as an argument.

3. I haven't tested this. Certainly you'd need to ensure that there are no syncronisation issues with output files, and you'd need to use the destDir option to save the workflow somewhere it won't get overwritten, or -nosave to not save the workflow.

As an additional note, here is a list of all available batch executor commands:
Usage: The following options are available: 
-nosave => do not save the workflow after execution has finished 
-reset => reset workflow prior to execution 
-failonloaderror => don't execute if there are errors during workflow loading 
-updateLinks => update metanode links to latest version 
-credential=name[;login[;password]] => for each credential enter credential name and optional login/password, otherwise its prompted for 
-masterkey[=...] => prompt for master password (used in e.g. database nodes), if provided with argument, use argument instead of prompting 
-preferences=... => path to the file containing eclipse/knime preferences, -workflowFile=... => ZIP file with a ready-to-execute workflow in the root of the ZIP 
-workflowDir=... => directory with a ready-to-execute workflow 
-destFile=... => ZIP file where the executed workflow should be written to if omitted the workflow is only saved in place 
-destDir=... => directory where the executed workflow is saved to if omitted the workflow is only saved in place 
-workflow.variable=name,value,type => define or overwrite workflow variable 'name' with value 'value' (possibly enclosed by quotes). The 'type' must be one of "String", "int" or "double". Some KNIME settings can also be adjusted by Java properties; they need to be provided as last option in the command line: 
-vmargs -Dorg.knime.core.maxThreads=n => sets the maximum number of threads used by KNIME The following return codes are defined: 
0 upon successful execution 
2 if parameters are wrong or missing 
3 when an error occurs during loading a workflow 
4 if an error during execution occurred

1 Like