Start a Knime workflow with a bat file

I like to start a Knime workflow automatically.

And therefor I was thinking if it is possible to start a specific workflow in Knime by using a run.bat file
If the name of the workflow is “Read all files in dir”
Are there commands you can put into a run.bat file where you can run this workflow in Knime, when Knime itself is already opened.

Hi,

as fare as I´m aware the command line options always start a new KNIME and you cannot attach to a already loaded KNIME. There is an python option which starts KNIME, but works the same.
The only option to run workflows in an already loaded KNIME instance is to use KNIME Server.

Best Regards,

Paul

Hi Paul,

So Knime has to be closed before you start a workflow in Knime with a run.bat file.
But then I need a way of automatically close Knime after the workflow is finished.
Because after an hour the run.bat file starts again and will open Knime again to run the workflow.

is there a way to close knime at the end of a workflow automatically?

thanks.

If it’s time based maybe the windows task scheduler can help you out

As far as I know KNIME closed after you run the workflow (in Batch mode, try this command: knime -nosplash -reset -application org.knime.product.KNIME_BATCH_APPLICATION -workflowDir=“workspace*your_workflow*”).
So you should design your workflow that it doesn’t take longer than the one hour. Also it is possible to run mutible instances of KNIME, but then you would get a performance decrease and maybe a problem when the same resources are accessed.

Hi @RonG,

I have a workflow scheduled to run every hour, it does pop up the command window but disappears itself. I found this on LinkedIn believe or not.

Rem Run KNIME workflow
“C:\knime_4.2.2\knime.exe” --launcher.suppressErrors -nosave -reset -nosplash -application org.knime.product.KNIME_BATCH_APPLICATION -workflowDir=“C:\knime-workspace\Tableau Server\Server Users”

This runs the workflow even with KNIME open, the only thing I cannot do is modify the triggered workflow while the process is running.

1 Like

It’s been a while since I “played around” with running Knime in command line, but as far as I remember, it was not an issue to have knime, or even the workflow opened while it was being run in command line.

If I remember correctly, I was doing a demo on how we could run 2 workflows one after the other on command line in a bat file, and I had the workflows open at the same time to show what workflows were supposed to be doing, and the bat file ran without any issues.

What are you running as command line?

hi, how did you schedule workflow?

Hello,

you can read how to run KNIME via Batch file here.
@Karlygash I think he used the Windows Task scheduler: Link
and then maybe a long enougth sleep/wait.

br,
sven

1 Like

thanks!
So in order to schedule some workflow I have to do the following steps:
1.Create a batch file
2. Use the command which is listed here FAQ | KNIME
3. Configure it in task scheduler
Am I right?)

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