# Execution of Knime Workflow in Batch Mode

**URL:** <https://forum.knime.com/t/execution-of-knime-workflow-in-batch-mode/10946>\
**Category:** KNIME Analytics Platform\
**Tags:** batch\
**Created:** [May 7, 2018, 4:30pm UTC](https://forum.knime.com/t/execution-of-knime-workflow-in-batch-mode/10946 "2018-05-07T16:30:00Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![adt\_pranab](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/a/51bf81/32.png) [@adt\_pranab](https://forum.knime.com/u/adt_pranab)\
**Post date:** [May 7, 2018, 4:30pm UTC](https://forum.knime.com/t/execution-of-knime-workflow-in-batch-mode/10946/1 "2018-05-07T16:30:00Z")

</div>

Can anyone please guide how to execute two or more than two Knime Workflow in batch mode.

---

<div class="post-metadata">

**Author:** ![christian.birkhold](https://forum-cdn.knime.com/user_avatar/forum.knime.com/christian.birkhold/32/346_2.png) [@christian.birkhold](https://forum.knime.com/u/christian.birkhold)\
**Post date:** [May 7, 2018, 5:45pm UTC](https://forum.knime.com/t/execution-of-knime-workflow-in-batch-mode/10946/2 "2018-05-07T17:45:46Z")

</div>

Hi @adt_pranab,

Check out [https://www.knime.com/faq#q12](https://www.knime.com/faq#q12). Does this help? Especially type `knime -nosplash -application org.knime.product.KNIME_BATCH_APPLICATION`​ to see a full list of argument.s

Best,

Christian

---

<div class="post-metadata">

**Author:** ![ScottMcLeodPSLGroup](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/s/7993a0/32.png) [@ScottMcLeodPSLGroup](https://forum.knime.com/u/ScottMcLeodPSLGroup)\
**Post date:** [May 8, 2018, 12:21am UTC](https://forum.knime.com/t/execution-of-knime-workflow-in-batch-mode/10946/3 "2018-05-08T00:21:09Z")

</div>

On the surface, running KNIME in batch looks relatively easy and it is. But its all the small details that can make it complex. The trick is to create a generic, highly parameterized batch job that can run any KNIME workflow.

I’ve attached two sample Powershell scripts that will run 1 to many KNIME workflows. When one fails, execution will halt (that behavior can be changed). In my example, I included execution of workflows that have variables in them like Database server URL which are set at run time. The first script executes the mail flow after calling the “settings” script to establish all the required KNIME environment settings.

Also critical in my view is that you are gathering a log file of all events from your script so you can see what KNIME is doing.

You can set this powershell script up to run through Windows scheduler. The program to run is “Powershell”. For the Arguments, you the script name “.\Knime\_Batch\_Job” and the Start-in parameter is the location where you powershell script will be stored.

[KnimeBatchPowershellScripts.zip](https://forum-cdn.knime.com/uploads/default/original/2X/d/dd3785b7c78605b39dae5086e1c499ce3209249d.zip) (3.0 KB)

---

<div class="post-metadata">

**Author:** ![adt\_pranab](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/a/51bf81/32.png) [@adt\_pranab](https://forum.knime.com/u/adt_pranab)\
**Post date:** [May 8, 2018, 8:12am UTC](https://forum.knime.com/t/execution-of-knime-workflow-in-batch-mode/10946/4 "2018-05-08T08:12:12Z")

</div>

Thanks, but I already have written the batch script.

---

<div class="post-metadata">

**Author:** ![adt\_pranab](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/a/51bf81/32.png) [@adt\_pranab](https://forum.knime.com/u/adt_pranab)\
**Post date:** [May 8, 2018, 8:12am UTC](https://forum.knime.com/t/execution-of-knime-workflow-in-batch-mode/10946/5 "2018-05-08T08:12:45Z")

</div>

@ScottMcLeodPSLGroup : Thanks for your script, this is really very helpful for me.

---

<div class="post-metadata">

**Author:** ![system](https://forum-cdn.knime.com/uploads/default/original/1X/ab3ccf34482a0329361734a18199390177204f15.png) [@system](https://forum.knime.com/u/system)\
**Post date:** [May 15, 2018, 8:12am UTC](https://forum.knime.com/t/execution-of-knime-workflow-in-batch-mode/10946/6 "2018-05-15T08:12:49Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ScottF](https://forum-cdn.knime.com/user_avatar/forum.knime.com/scottf/32/61316_2.png) [@ScottF](https://forum.knime.com/u/ScottF)\
**Post date:** [August 28, 2020, 6:08pm UTC](https://forum.knime.com/t/execution-of-knime-workflow-in-batch-mode/10946/7 "2020-08-28T18:08:00Z")

</div>


