# Workflow execution model

**URL:** <https://forums.losant.com/t/workflow-execution-model/2098>\
**Category:** Help\
**Tags:** workflow\
**Created:** [August 17, 2019, 1:09pm UTC](https://forums.losant.com/t/workflow-execution-model/2098 "2019-08-17T13:09:27Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![paul\_wareham](https://avatars.discourse-cdn.com/v4/letter/p/ed8c4c/32.png) [@paul\_wareham](https://forums.losant.com/u/paul_wareham)\
**Post date:** [August 17, 2019, 1:09pm UTC](https://forums.losant.com/t/workflow-execution-model/2098/1 "2019-08-17T13:09:27Z")

</div>

I was wondering if someone might be able to describe the execution model for workflows?

Are workflows blocked during execution or will another thread execute the same workflow code if a new trigger is received from a second device while the previous run from a first device was still executing?

I’m considering introducing a delay node but I’m thinking through the consequences of dong so when my workflow triggers are asynchronously arriving at unknown times and frequency from many devices.

Thanks

Paul

---

<div class="post-metadata">

**Author:** ![JuliaKempf](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/juliakempf/32/2446_2.png) [@JuliaKempf](https://forums.losant.com/u/JuliaKempf)\
**Post date:** [August 19, 2019, 1:53pm UTC](https://forums.losant.com/t/workflow-execution-model/2098/2 "2019-08-19T13:53:10Z")

</div>

Hi @paul_wareham,

We do have a Losant University chapter on this, it can be found on [this page](https://www.losant.com/university), and is Course 5, Chapter 4: Workflow Mechanics. Workflows are never blocked for another flow, so each trigger will kick off its own flow. If you did need to use data from a previous run, however, you can share state using workflow storage.

Thanks!  
Julia

---

<div class="post-metadata">

**Author:** ![paul\_wareham](https://avatars.discourse-cdn.com/v4/letter/p/ed8c4c/32.png) [@paul\_wareham](https://forums.losant.com/u/paul_wareham)\
**Post date:** [August 19, 2019, 4:19pm UTC](https://forums.losant.com/t/workflow-execution-model/2098/3 "2019-08-19T16:19:00Z")

</div>

@JuliaKempf

Thank you. The university chapter was great (the hyperlink in your post goes to the wrong page by the way).

The chapter doesn’t specifically address multiple executions of the same workflow. However, my understanding from your comment is that the **same** workflow can be triggered multiple times and each of the flows will essentially be executed in parallel. For example, let’s say we have a workflow to parse data from devices triggered by a Webhook which will ultimately update state. The webhook can be triggered by multiple devices at any time. Device 1 might trigger the workflow and before its finished executing, Device 2 might trigger the same workflow. However the first execution for Device 1 **will not** block the execution relating to Device 2.

Just double-checking that my understanding is correct.

Thank you!

Paul

---

<div class="post-metadata">

**Author:** ![anaptfox](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/anaptfox/32/873_2.png) [@anaptfox](https://forums.losant.com/u/anaptfox)\
**Post date:** [August 19, 2019, 4:36pm UTC](https://forums.losant.com/t/workflow-execution-model/2098/4 "2019-08-19T16:36:54Z")

</div>

@paul_wareham,

Yes you are correct. Workflow runs do not affect other runs (unless you’re doing so explicitly with Workflow Storage). You can think of each Workflow as its own stateless function. It is correct to _assume_ that Workflows be executed in parallel, but all in all, no order is guaranteed.

---

<div class="post-metadata">

**Author:** ![paul\_wareham](https://avatars.discourse-cdn.com/v4/letter/p/ed8c4c/32.png) [@paul\_wareham](https://forums.losant.com/u/paul_wareham)\
**Post date:** [August 19, 2019, 5:05pm UTC](https://forums.losant.com/t/workflow-execution-model/2098/5 "2019-08-19T17:05:37Z")

</div>

very clear. Thank you so much guys!
