Execute Workflow in Batch Mode Windows 10

This was the issue! I changed to workflowDir and I have had several successfuls tests. Thank you.

2 Likes

Hello, I hope you could help me. I’m a beginner with running things through cmd and I get this error

hi @Ana914 , you are missing the opening double quotes before c:\Program. ("C:\Program Files…)

Also, make sure that it is the correct path of your installed Knime.

2 Likes

Thanks for your reply, Bruno! I started it but it returns an exit Code = 2, do you have any idea why?

Hi @Ana914 , an exit code 2 means that the parameters you are passing are wrong. Looking at your command line, you need to enclose what you are passing as workflowDir in quotes too, as you have spaces in your workflow name (like Program Files).

So, you need to add the quotes to workflowDir=“C:\Users… TEST1”

3 Likes

Thanks, Bruno! Now it doesn’t show that window which may be good? But I’m also not sure if it’s successful.

Apologies for my series of questions

The end node of my workflow is an Excel writer and I’ve set it up to open the Excel file it wrote. When running the workflow through cmd, would it also do the same?

Hi @Ana914 , yes, it means that there was no error. You can also physically check the Excel file was written.

In terms of opening the Excel file, I can’t answer that without seeing what you are doing.

1 Like

Hello @bruno29a

Thanks for your patience.

Basically, my workflow is just ETL of Excel files

My final node is set to open the Excel file upon execution.

Hi @Ana914 , I am not sure how this “interaction” (open after execution) behaves when executed via the command line. You can try and see if the file is opened.
If it does not open, you can open it via the command line after you run the knime workflow

3 Likes

thanks bruno for your help! :slight_smile:

1 Like

Hi everyone. Please I need your help for to resolve the next errors in proccess batch:
Restore the connection in some nodes with “MySQL Connector” node and one error with grouping column. I used group function COUNT(*) in SQL instruction using “DB SQL Executor” node but I’m not need to add it one Group By…


[quote=“mlauber71, post:2, topic:13986”]
“C:\Program Files\KNIME\knime.exe” -nosave -consoleLog -noexit -nosplash -reset -application org.knime.product.KNIME_BATCH_APPLICATION -workflowDir=“C:\Users\mfarran\knime-workspace\test”
[/quote]\

Hello, what if I quoted in right way, but it still gives me an error?


Hi @Karlygash , you are pointing the workflowDir, which means Directory, which means folder, to a workflow file (test.knwf), and as the error message says “is not a Directory”.

You just need to point the workflowDir to the folder where the workflow is.

Alternatively, if that folder has several workflow files, and you want to specifically run the test.knwf only, then use workflowFile instead where you can point to the test.knwf file.

1 Like

thanks, it helped me
Should i get .bat file in that folder?


image
I have one more question, I ve read from different articles that I can schedule workflows using task manager. I am not good at scheduling, so I launched this command
“C:\Program Files\KNIME\knime.exe” -nosave -consoleLog -noexit -nosplash -reset -application org.knime.product.KNIME_BATCH_APPLICATION -workflowDir=“C:\Users\Karlygash_Mukhitova\please\StringLengthsss”
Can you please, help me, what is my next steps in order to schedule current workflow?

Well if you go to task scheduler in your windows system (you can just type it to search for it) and create a new task. You can set the exact execution time of the command.
br

HI Guys,

I am trying to run the knime workflow in batch mode and using this command

“C:\Program Files\KNIME\knime.exe” -nosave -consoleLog -noexit -nosplash -reset -application org.knime.product.KNIME_BATCH_APPLICATION -workflowFile=“C:\Users<username>\Test.zip”

I have also tried running it by using

“C:\Program Files\KNIME\knime.exe” -nosave -consoleLog -noexit -nosplash -reset -application org.knime.product.KNIME_BATCH_APPLICATION -
workflowDir=“C:\Users<username>\knime-workspace\Test”

But it’s giving me the same error.

Hello @hdonga,

I don’t know if you still have the error or the need to correct this issue, but i was struggling and find out a solution :

  • use of --launcher.suppressErrors
  • put the workflow directory path before “-application org.knime.product.KNIME_BATCH_APPLICATION”
  • use of slashes for the workflow directory instead of backslashes
"C:\Program Files\KNIME\knime.exe" -nosave -consoleLog -noexit -nosplash -reset -workflowDir="C:/Users<username>/knime-workspace/Test" --launcher.suppressErrors -application org.knime.product.KNIME_BATCH_APPLICATION

Hope it helps anyone :smiley:

Br,
Samir

3 Likes

@hdonga,
Exit code 4 refers to errors during workflow execution. If you are sure your workflow runs successfully with the same inputs manually, it might be using relative paths in your file handling nodes. Try using absolute paths and see if running the workflow in batch mode still fails.

Here is a screenshot from the archives since the site does no longer exist.

https://web.archive.org/web/20190705041125/http://docs.hpc.shef.ac.uk/en/latest/iceberg/software/apps/knime.html

3 Likes