Proper way to run a Knime workflow in batch mode

Hi everyone

I’m trying to run a simple workflow using Knime in batch mode. The input is an XML and the output a JSON file. I want to set the input and output file using -workflow.variable, so what I did is first set the input and output variables at the “Workflow variable administration”:

2018-05-10%2017_31_50-KNIME%20Analytics%20Platform

And then replace the flow variable for this “input_xml_file”:

In this way I expected to run this workflow in batch mode (Linux) using the following command:

knime --launcher.suppressErrors -nosplash -application org.knime.product.KNIME_BATCH_APPLICATION -reset -nosave -workflowFile="/users/pr/rolivella/mydata/knwf/XML_Reader.knwf" -workflow.variable=input_xml_file,/users/pr/rolivella/mydata/xml/books.xml,String -workflow.variable=output_json_file,/users/pr/rolivella/json/authors.json,String

Where I’m overriding the values of input_xml_file and output_json_file. But I get:

WARN main Node Input file ‘/users/pr/rolivella/mydata/xml/default.xml’ does not exist
WARN main Node Output directory ‘/nfs/users/pr/backuppr/C:\Users\rolivella\Desktop’ does not exist
WARN main Node Output directory ‘/nfs/users/pr/backuppr/C:\Users\rolivella\Desktop’ does not exist
WARN KNIME-Worker-0 Node Output directory ‘/nfs/users/pr/backuppr/C:\Users\rolivella\Desktop’ does not exist

What can I do?

Many thanks!

Roger

PS. The workflow:

XML_Reader.knwf (10.1 KB)

I found the error. I was assuming that the “Jason Writer” node inputs a JSON file, but in reallity inputs a folder.

So chaning the:

workflow.variable=output_json_file,/users/pr/rolivella/json/authors.json

to

workflow.variable=output_json_file,/users/pr/rolivella/json

fixed the problem!

Roger

Hi @rolivella -

Glad you got it working. And thanks for posting the solution!

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.