Execute Workflow in Batch Mode Windows 10

I have read several posts on this subject, but so far no luck.

I have created a very simple workflow just to see if I can get a bat to work.
Here is what I have so far.
“C:\Program Files\KNIME\knime.exe” -reset -nosave -nosplash -application org.knime.product.KNIME_BATCH_APPLICATION -workflowdir=“C:/Users/mfarran/knime-workspace/test”

Can someone please let me know what I have done wrong?

test.knwf (6.6 KB)

Have you tried it like this:

"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"

This should open a separate window where more messages will appear and the window will stay open so you can see what it says (consoleLog).

And there is something like a documentation here (not an official one):

http://docs.hpc.shef.ac.uk/en/latest/iceberg/software/apps/knime.html

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
2 Likes

Hi there!

How do you run and after you run it what happens? Do you get some error or workflow is executed or something third?

Br,
Ivan

test_txt.docx (18 KB)

Thanks for replying. I am intentionally keeping my workflow simple (i.e. Create table -> write to xls file)
so that I can solve the issues with running bat. Attached are the errors I get when running.

All of those “stack traces” mentioning org.apache.aries.blueprint followed by a lot of at ... lines are expected and “normal” (and at some future point going away as discussed here: Knime Analytics Platform V.3.6 error in Batch Mode )

The salient item in your logs is the last line:

ERROR    main BatchExecutor      Unknown option '-workflowdir'

I suspect this is case sensitive, please try workflowDir

4 Likes

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