Excutable in Batch Mode

Dear all

Could anyone write me how to implement KNIME work-flow in executable mode? There is limited information is provided in the FAQ. It would be nice if someone tells me how to submit the jobs and get the result and some useful comments
Basically, I have two workflows in the same folder.
Actually i don’t know to run the workflow in mode batch

Whenn i try to run this Command in the cmd knime -nosplash -application org.knime.product.KNIME_BATCH_APPLICATION -workflowFile="Automatically_Hiliting_And_Generating_Roche_Report_V3.zip"

I got this Error

Best regards

Hi @mokrani -

Here’s an example of what happens when I try to run a workflow called “Scratchpad” in my default KNIME workspace. I’m using Windows here:

Exit code 3 occurs when KNIME can’t load the workflow. I suggest providing the explicit path to your workflow, and use the -workflowDir option (since you’re not loading a ZIP file).

Thanks ScottF,
But now I got this error because inside the Zip file I have two workflows.

I would try a couple more things:

  1. Close all open instances of KNIME before executing from the command line (you may already be doing this)
  2. Try using the -workflowDir option on an uncompressed directory, rather than the -workflowFile option

Do either of those help?

yes i do that and its work but i have this problem acualy im using google api to get some document then extract them to Dir Temp using create Temp Dir NODE

I made the following workflow to see if I could duplicate the problem:


Interestingly, it seems that while this workflow runs fine in the GUI, it throws permissions errors similar to what you’re seeing in batch mode. It’s not clear to me why this should be, so I’ll have to follow up with one of our developers.

when you run your workflow in mode batch you get the same error like me ?

Yes, that’s correct - see below. I’ll do some digging and try to find out more.

1 Like

Please when you find a solution let me know

Thank you!!

Hi @mokrani -

I think we have a solution - but before I post that, let me elaborate a little bit about what’s going on.

The first thing to note is that the permissions warnings can be safely ignored - these are being generated by the Google API in a bug that dates back a few years.

If we use the Create Temp Dir node as above, KNIME deletes the temporary directory as soon as it shuts down. This explains why we are able to see the output file when we run in GUI mode, but not in headless batch mode. In batch mode, the outputs are actually generated as intended, they are just wiped from the disk before we can read them.

The solution lies in using a slightly different node - Create Directory. The directory created by this node sticks around permanently. Here’s a workflow:

GoogleSheetsTempDirExample.knwf (11.5 KB)


Thanks for posting about this - I learned something new when trying to untangle it!

1 Like

@Mokrani - I assume that this relates to some of your previous posts about reporting, in which case the temp file disappearing shouldnt be an issue for you as by then it will have been sent as an email attachment?


yes exactly the file need to be saved in the temp dir Directory then sent it via email node

I have a problem with mode batch the first execution it works well but when I want to run the workflow batch every hour I receive this error
Mean the instance still running how can shut down the instance after finishing the JOB task

this my batch file:

@echo off
cd C:\Program Files\KNIME
knime.exe -nosplash -application org.knime.product.KNIME_BATCH_APPLICATION -consoleLog -noexit -reset -workflowDir=“C:\Users\mokrania\knime-workspace\Roche_report\Automatically_Hiliting_And_Generating_Roche_Report_V3\Generate_a_Report_and_Sent_it_to_Email”

Unfortunately, when I made a batch file to investigate, I couldn’t duplicate the error you’re seeing about the workflow being in use by another instance.

When you run the batch file the second time, are all previous instances of KNIME (both batch and GUI) closed?

If so, have you tried running without the -noexit option?

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