# How to run two spawned exec nodes sequential

**URL:** https://discourse.nodered.org/t/how-to-run-two-spawned-exec-nodes-sequential/16511
**Category:** General
**Created:** [9 October 2019 15:49 UTC](https://discourse.nodered.org/t/how-to-run-two-spawned-exec-nodes-sequential/16511 "2019-10-09T15:49:35Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![pvink](https://avatars.discourse-cdn.com/v4/letter/p/779978/32.png) [@pvink](https://discourse.nodered.org/u/pvink)
#### Post date: [9 October 2019 15:49 UTC](https://discourse.nodered.org/t/how-to-run-two-spawned-exec-nodes-sequential/16511/1 "2019-10-09T15:49:35Z")

</div>

Hello Node-RED forum,

I have only just started so please forgive me my 'beginners problems',

I am running two commands in exec nodes, they should run sequential (second program uses the output of the first). This works fine when I just put one behind the next.  
However, I have now also connected a node to update me on progress (through websocket).

When I try to run the first node in spawned mode my progress updates look much better (program takes some time), but my second node gets triggered every time (as I could expect).

My question: Is there a trick to let the second exec node run after the first finishes but where the first node can still run in 'spawned' mode to provide constant updates ?

like I said, this might sound quite trivial, but I can't seem to get it working so I hope the forum can help.

Cheers,  
Peter

---

<div class="post-metadata">

### Author: ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)
#### Post date: [9 October 2019 16:59 UTC](https://discourse.nodered.org/t/how-to-run-two-spawned-exec-nodes-sequential/16511/2 "2019-10-09T16:59:23Z")

</div>

The 3rd output on the exec node is the return code so that shouldn’t fire until complete

---

<div class="post-metadata">

### Author: ![pvink](https://avatars.discourse-cdn.com/v4/letter/p/779978/32.png) [@pvink](https://discourse.nodered.org/u/pvink)
#### Post date: [11 October 2019 15:20 UTC](https://discourse.nodered.org/t/how-to-run-two-spawned-exec-nodes-sequential/16511/3 "2019-10-11T15:20:56Z")

</div>

Thank you !

I was certain that I had tried that already but turns out that now everything is working fine...
