# Start a Workflow, e. g. a database query, after a certain time

**URL:** <https://forum.knime.com/t/start-a-workflow-e-g-a-database-query-after-a-certain-time/30287>\
**Category:** KNIME Analytics Platform\
**Created:** [January 28, 2021, 12:33pm UTC](https://forum.knime.com/t/start-a-workflow-e-g-a-database-query-after-a-certain-time/30287 "2021-01-28T12:33:29Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![USCHUKN1ME](https://forum-cdn.knime.com/user_avatar/forum.knime.com/uschukn1me/32/54657_2.png) [@USCHUKN1ME](https://forum.knime.com/u/USCHUKN1ME)\
**Post date:** [January 28, 2021, 12:33pm UTC](https://forum.knime.com/t/start-a-workflow-e-g-a-database-query-after-a-certain-time/30287/1 "2021-01-28T12:33:29Z")

</div>

Hi,

is it possible to start a Workflow, e. g. a database query, after a certain time?

**My workflow :**

 ![Frage Workflow-Start-nach-Ablauf einer Zeit](https://forum-cdn.knime.com/uploads/default/original/3X/6/a/6a7184895dd5301f428d30f44f85f9340b08a19a.png)

Thx in advance!

Greetings

---

<div class="post-metadata">

**Author:** ![iperez](https://forum-cdn.knime.com/user_avatar/forum.knime.com/iperez/32/24881_2.png) [@iperez](https://forum.knime.com/u/iperez)\
**Post date:** [January 28, 2021, 2:42pm UTC](https://forum.knime.com/t/start-a-workflow-e-g-a-database-query-after-a-certain-time/30287/2 "2021-01-28T14:42:10Z")

</div>

Hi @USCHUKN1ME . Have you checked the wait node in Workflow automation?

![imagen](https://forum-cdn.knime.com/uploads/default/original/3X/0/4/0447e0590ed67ca9926a8c7afe41749462ce08c4.png)

---

<div class="post-metadata">

**Author:** ![USCHUKN1ME](https://forum-cdn.knime.com/user_avatar/forum.knime.com/uschukn1me/32/54657_2.png) [@USCHUKN1ME](https://forum.knime.com/u/USCHUKN1ME)\
**Post date:** [January 29, 2021, 1:06pm UTC](https://forum.knime.com/t/start-a-workflow-e-g-a-database-query-after-a-certain-time/30287/3 "2021-01-29T13:06:24Z")

</div>

Hello iperez,

no , I did not know this node yet, thanks for the tip.

Where do I put them in the workflow? Betöre the query, after the  
query ?

![Wait Node wie konfigurieren](https://forum-cdn.knime.com/uploads/default/original/3X/d/8/d8fbc019383c6254ce3fb271ca95e603fb14a194.png)

Greetings

---

<div class="post-metadata">

**Author:** ![iperez](https://forum-cdn.knime.com/user_avatar/forum.knime.com/iperez/32/24881_2.png) [@iperez](https://forum.knime.com/u/iperez)\
**Post date:** [January 29, 2021, 1:46pm UTC](https://forum.knime.com/t/start-a-workflow-e-g-a-database-query-after-a-certain-time/30287/4 "2021-01-29T13:46:43Z")

</div>

Hi @USCHUKN1ME . Put it before the node you want to be executed (or the start of the workflow) after a specific time. In your case my guess is that you can connect it to the DB Connector or the DB Query

---

<div class="post-metadata">

**Author:** ![Iris](https://forum-cdn.knime.com/user_avatar/forum.knime.com/iris/32/14_2.png) [@Iris](https://forum.knime.com/u/Iris)\
**Post date:** [January 29, 2021, 1:50pm UTC](https://forum.knime.com/t/start-a-workflow-e-g-a-database-query-after-a-certain-time/30287/5 "2021-01-29T13:50:53Z")

</div>

@USCHUKN1ME you need the flow variable ports for this. You can right click on the node and say Show Flow Variable Ports, than you find it.

---

<div class="post-metadata">

**Author:** ![USCHUKN1ME](https://forum-cdn.knime.com/user_avatar/forum.knime.com/uschukn1me/32/54657_2.png) [@USCHUKN1ME](https://forum.knime.com/u/USCHUKN1ME)\
**Post date:** [January 29, 2021, 2:15pm UTC](https://forum.knime.com/t/start-a-workflow-e-g-a-database-query-after-a-certain-time/30287/6 "2021-01-29T14:15:20Z")

</div>

> [@iperez](#):
>
> Put it before the node you want to be executed (or the start of the workflow) after a specific time. In your case my guess is that you can connect it to the DB Connector or the DB Query

Unfortunately, the node cannot be placed in between - the connections  
are not possible!

![WAIT Node keine Verknüpfung möglich](https://forum-cdn.knime.com/uploads/default/original/3X/7/8/78b5c31d6b4740163d81457cb3ef590eff2f7a99.png)

---

<div class="post-metadata">

**Author:** ![USCHUKN1ME](https://forum-cdn.knime.com/user_avatar/forum.knime.com/uschukn1me/32/54657_2.png) [@USCHUKN1ME](https://forum.knime.com/u/USCHUKN1ME)\
**Post date:** [January 29, 2021, 2:18pm UTC](https://forum.knime.com/t/start-a-workflow-e-g-a-database-query-after-a-certain-time/30287/7 "2021-01-29T14:18:31Z")

</div>

Hi Iris,

i do that but … 🤔… Now I don’t know exactly what to do here?

 ![WAIT Node flow variable](https://forum-cdn.knime.com/uploads/default/original/3X/5/9/592265e478e9a99b19634114e03523dc606add4d.png)

---

<div class="post-metadata">

**Author:** ![iperez](https://forum-cdn.knime.com/user_avatar/forum.knime.com/iperez/32/24881_2.png) [@iperez](https://forum.knime.com/u/iperez)\
**Post date:** [January 29, 2021, 3:05pm UTC](https://forum.knime.com/t/start-a-workflow-e-g-a-database-query-after-a-certain-time/30287/8 "2021-01-29T15:05:07Z")

</div>

As @Iris suggested you need the flow variables port:

 ![imagen](https://forum-cdn.knime.com/uploads/default/original/3X/a/9/a985bd5237b3d8f8ca54e1d21bb14e543b676bd6.png)

---

<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:** [January 29, 2021, 5:05pm UTC](https://forum.knime.com/t/start-a-workflow-e-g-a-database-query-after-a-certain-time/30287/9 "2021-01-29T17:05:42Z")

</div>

To clarify a bit: it turns out that ALL nodes have flow variable ports - they are always there on the top left and right corners of the node, even if you don’t see them.

If you want to use them in this case, click “Show Flow Variable Ports” on the nodes you want to connect to, not the Wait node.

Make sense? 🙂

---

<div class="post-metadata">

**Author:** ![USCHUKN1ME](https://forum-cdn.knime.com/user_avatar/forum.knime.com/uschukn1me/32/54657_2.png) [@USCHUKN1ME](https://forum.knime.com/u/USCHUKN1ME)\
**Post date:** [January 29, 2021, 5:24pm UTC](https://forum.knime.com/t/start-a-workflow-e-g-a-database-query-after-a-certain-time/30287/10 "2021-01-29T17:24:33Z")

</div>

Aha, i need the Variable prots from the DB Query Node not from the WAIT Node! 🙂

![WAIT Node connect to DB Query Node flow variable](https://forum-cdn.knime.com/uploads/default/original/3X/8/6/8643f06efe246e4a061392be4f381b05e6a3b5f6.png)

Is it possible to specify **several times**? Loop?  
As I see it now, the workflow only starts when the time, you specify, has been reached. And  
that’s just only one time. The WAIT-Node blocks the workflow as long as!

As you can see the WAIT Node is green, but the DB Query and the rest  
of the workflow is set to yellow resp. red.

![WAIT Node Zeit erreicht grün aber Query startet nicht automatisch](https://forum-cdn.knime.com/uploads/default/original/3X/5/0/500d4fabf9af573c17e85517e0ebb16dca7b12e1.png)

Have I made a mistake in my thinking?

Thx in advance .

greetings

---

<div class="post-metadata">

**Author:** ![iperez](https://forum-cdn.knime.com/user_avatar/forum.knime.com/iperez/32/24881_2.png) [@iperez](https://forum.knime.com/u/iperez)\
**Post date:** [January 29, 2021, 7:45pm UTC](https://forum.knime.com/t/start-a-workflow-e-g-a-database-query-after-a-certain-time/30287/11 "2021-01-29T19:45:08Z")

</div>

HI. Your reasoning is right: the wait node is green since it has been executed, it’ll block the following nodes execution according to the configuration made.  
I don’t think you can loop as you wish. Using the server you can schedule the execution of a workflow as it suits you.

---

<div class="post-metadata">

**Author:** ![USCHUKN1ME](https://forum-cdn.knime.com/user_avatar/forum.knime.com/uschukn1me/32/54657_2.png) [@USCHUKN1ME](https://forum.knime.com/u/USCHUKN1ME)\
**Post date:** [January 30, 2021, 2:28pm UTC](https://forum.knime.com/t/start-a-workflow-e-g-a-database-query-after-a-certain-time/30287/12 "2021-01-30T14:28:45Z")

</div>

Hello @iperez ,

thx for your response.

Ok i understand: The Wait-Node is not possible to use it more than one times.

But is it possible to **start the workflow** follows the wait node **automatically** , as soon as the time in the WAIT node reaches and it jumps to green?

Greetings

---

<div class="post-metadata">

**Author:** ![Daniel\_Weikert](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/d/e47c2d/32.png) [@Daniel\_Weikert](https://forum.knime.com/u/Daniel_Weikert)\
**Post date:** [January 30, 2021, 4:28pm UTC](https://forum.knime.com/t/start-a-workflow-e-g-a-database-query-after-a-certain-time/30287/13 "2021-01-30T16:28:35Z")

</div>

Maybe you can connect the wait node at the very first node in your workflow to achieve this? Other option comes to mind would be to use KNIME in batch mode and try to let windows do the task  
br

---

<div class="post-metadata">

**Author:** ![mlauber71](https://forum-cdn.knime.com/user_avatar/forum.knime.com/mlauber71/32/73590_2.png) [@mlauber71](https://forum.knime.com/u/mlauber71)\
**Post date:** [January 31, 2021, 7:05pm UTC](https://forum.knime.com/t/start-a-workflow-e-g-a-database-query-after-a-certain-time/30287/14 "2021-01-31T19:05:09Z")

</div>

Have you tried to put the times you want the workflows to start in a table (you might create this table dynamically) and then use a Loop that would activate the wait node.

---

<div class="post-metadata">

**Author:** ![USCHUKN1ME](https://forum-cdn.knime.com/user_avatar/forum.knime.com/uschukn1me/32/54657_2.png) [@USCHUKN1ME](https://forum.knime.com/u/USCHUKN1ME)\
**Post date:** [February 1, 2021, 11:32am UTC](https://forum.knime.com/t/start-a-workflow-e-g-a-database-query-after-a-certain-time/30287/15 "2021-02-01T11:32:16Z")

</div>

Hello @Daniel_Weikert ,

you meanlike that ?

 ![WAIT Node connect to DB Connector Node flow variable](https://forum-cdn.knime.com/uploads/default/original/3X/0/c/0c3e183f2122ae750c8c8026f40516c1072c7a86.png)

![Wait Node Config](https://forum-cdn.knime.com/uploads/default/original/3X/2/e/2e3eb4e70ae2b6ac72a8bb5c6300f937bc615c23.png)

Greetings

---

<div class="post-metadata">

**Author:** ![USCHUKN1ME](https://forum-cdn.knime.com/user_avatar/forum.knime.com/uschukn1me/32/54657_2.png) [@USCHUKN1ME](https://forum.knime.com/u/USCHUKN1ME)\
**Post date:** [February 1, 2021, 11:38am UTC](https://forum.knime.com/t/start-a-workflow-e-g-a-database-query-after-a-certain-time/30287/16 "2021-02-01T11:38:42Z")

</div>

Hello @mlauber71 ,

you mean like that:

![Table creator mit verschiedenen Startzeiten](https://forum-cdn.knime.com/uploads/default/original/3X/1/b/1b553386edb4a638f3bfbf20722d0c1cce5fa5ec.png)

But how can i connect it with the Wait-Node?

![Table creator connect to WIAT Node](https://forum-cdn.knime.com/uploads/default/original/3X/8/9/8908e11b94abb670ee88dae6262d2c8b5bcf8d9e.png)

Greetings

---

<div class="post-metadata">

**Author:** ![mlauber71](https://forum-cdn.knime.com/user_avatar/forum.knime.com/mlauber71/32/73590_2.png) [@mlauber71](https://forum.knime.com/u/mlauber71)\
**Post date:** [February 1, 2021, 12:30pm UTC](https://forum.knime.com/t/start-a-workflow-e-g-a-database-query-after-a-certain-time/30287/17 "2021-02-01T12:30:17Z")

</div>

@USCHUKN1ME you could try and use a:

> **[Table Row To Variable Loop Start](https://hub.knime.com/knime/extensions/org.knime.features.base/latest/org.knime.base.node.meta.looper.variable.start.LoopStartVariable3NodeFactory)**
>
> This node uses each row of a data table to define new variable values for each loop iteration. The names of the variables are defined by the column names.

and see if you could integrate that with the Wait node. You might have to add a dated but I have not tried that yet.

About Loops in general there is this collection:

> **[A meta collection about Loops, Paths and Flow Variables in KNIME (and some...](https://hub.knime.com/mlauber71/spaces/Public/latest/_loops_and_flow_variables_knime)**
>
> A meta collection about Loops, Paths and Flow Variables in KNIME (and some ZIP files) Start with KNIME's Flow Control Guide https://docs.knime.com/latest/analy…

---

<div class="post-metadata">

**Author:** ![USCHUKN1ME](https://forum-cdn.knime.com/user_avatar/forum.knime.com/uschukn1me/32/54657_2.png) [@USCHUKN1ME](https://forum.knime.com/u/USCHUKN1ME)\
**Post date:** [February 1, 2021, 4:24pm UTC](https://forum.knime.com/t/start-a-workflow-e-g-a-database-query-after-a-certain-time/30287/18 "2021-02-01T16:24:50Z")

</div>

Hi @mlauber71 ,

thank your for the tipp.

I have a look to:  
[Loop example](https://hub.knime.com/knime/spaces/Examples/latest/06_Control_Structures/04_Loops/12_Using_TableRows_as_FlowVariables_in_Loop)

What must the parameter settings be so that the loop processes all  
three lines of the table and passes the start time contained therein to the wait  
node?

![Table creator connect to LOOP-Node to WAIT Node](https://forum-cdn.knime.com/uploads/default/original/3X/7/c/7c5aef900c2d74ce4e21156c797b65f8a850aa43.png)

**Table-Creator**  
 ![Table creator mit verschiedenen Startzeiten](https://forum-cdn.knime.com/uploads/default/original/3X/e/f/ef54b595a40279a23ba929e77f77598c8118abe7.png)

**Loop Node Settings**

![Loop Node Config](https://forum-cdn.knime.com/uploads/default/original/3X/c/d/cdaafced266b593714ad338dbdc7a7b3c6549052.png)

**Wait-Node Settings?**  
 ![Wait Node Config 2](https://forum-cdn.knime.com/uploads/default/original/3X/c/b/cbe26df0160f856f52e135f82704651e4be46a0c.png)

Thx in advance

greetings

---

<div class="post-metadata">

**Author:** ![mlauber71](https://forum-cdn.knime.com/user_avatar/forum.knime.com/mlauber71/32/73590_2.png) [@mlauber71](https://forum.knime.com/u/mlauber71)\
**Post date:** [February 1, 2021, 5:22pm UTC](https://forum.knime.com/t/start-a-workflow-e-g-a-database-query-after-a-certain-time/30287/19 "2021-02-01T17:22:47Z")

</div>

@USCHUKN1ME you could take a look at this example. It uses the current execution time and adds 25, 45, and 65 seconds and then waits until the new shifted time has been reached.

Please note: If the time of day has passed when the workflow reaches the Wait node it will wait until the same time next day!

 ![image](https://forum-cdn.knime.com/uploads/default/original/3X/1/5/157673717dc2a9d88fcf892d27db645580d671fc.png)

> **[use the Wait node to execute a database query at fixed times – mlauber71](https://hub.knime.com/mlauber71/spaces/Public/latest/kn_example_db_wait_execute)**
>
> use the Wait node to execute a database query at fixed times Please note: If the time of day has passed when the workflow reaches the Wait node it will wait un…

---

<div class="post-metadata">

**Author:** ![USCHUKN1ME](https://forum-cdn.knime.com/user_avatar/forum.knime.com/uschukn1me/32/54657_2.png) [@USCHUKN1ME](https://forum.knime.com/u/USCHUKN1ME)\
**Post date:** [February 2, 2021, 9:30am UTC](https://forum.knime.com/t/start-a-workflow-e-g-a-database-query-after-a-certain-time/30287/20 "2021-02-02T09:30:17Z")

</div>

@mlauber71 thank you.

I will try it.

Where do I have to place the **Node LOOP-End**? Since I have a  
component at the end l’m not sure!

![Component am Ende des Worklfows](https://forum-cdn.knime.com/uploads/default/original/3X/2/b/2b1ef2f287313a75b36b2ecff38efc98c93b352e.png)

![Component Open-View am Ende des Worklfows](https://forum-cdn.knime.com/uploads/default/original/3X/7/9/7999e4a2f22719bb3e7f98f2577c28cc4c07a0bd.png)

greetings

[Next page](https://forum.knime.com/t/start-a-workflow-e-g-a-database-query-after-a-certain-time/30287.md?page=2)
