# Multiple Instances of a workflow

**URL:** <https://discourse.nodered.org/t/multiple-instances-of-a-workflow/2093>\
**Category:** General\
**Created:** [6 August 2018 10:08 UTC](https://discourse.nodered.org/t/multiple-instances-of-a-workflow/2093 "2018-08-06T10:08:03Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![sourcedexter](https://avatars.discourse-cdn.com/v4/letter/s/e5b9ba/32.png) [@sourcedexter](https://discourse.nodered.org/u/sourcedexter)\
**Post date:** [6 August 2018 10:08 UTC](https://discourse.nodered.org/t/multiple-instances-of-a-workflow/2093/1 "2018-08-06T10:08:03Z")

</div>

I wanted to know If I can deploy a workflow and then create multiple instances of it.  
Here is an example:

Let's assume that there is a workflow that takes in a vehicle number and state and checks if that vehicle has visited the state on not.

Is it possible for multiple people to send requests to this workflow simultaneously and get responses according to their input?

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [6 August 2018 10:36 UTC](https://discourse.nodered.org/t/multiple-instances-of-a-workflow/2093/3 "2018-08-06T10:36:56Z")

</div>

> [@sourcedexter](#):
>
> Is it possible for multiple people to send requests to this workflow simultaneously and get responses according to their input?

It depends on the specifics of the flow, but generally yes.

If it's http based, then each request is handled separately and it's up to you to decide how the users are identified in the request.

---

<div class="post-metadata">

**Author:** ![sourcedexter](https://avatars.discourse-cdn.com/v4/letter/s/e5b9ba/32.png) [@sourcedexter](https://discourse.nodered.org/u/sourcedexter)\
**Post date:** [6 August 2018 10:42 UTC](https://discourse.nodered.org/t/multiple-instances-of-a-workflow/2093/4 "2018-08-06T10:42:50Z")

</div>

Okay, thanks.  
From the last time I had used Node red, if another request was sent to the flow, instead of a new instance, it would continue the same one.  
So effectively, each deployed workflow was as if it's just one instance, and all who wish to use it can see the same state.

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [6 August 2018 14:21 UTC](https://discourse.nodered.org/t/multiple-instances-of-a-workflow/2093/5 "2018-08-06T14:21:00Z")

</div>

Like I said, it depends on the specifics of the flow.

If you build a flow that holds state, then you need to decide how to store that state per user so you can distinguish between the different requests.

---

<div class="post-metadata">

**Author:** ![sourcedexter](https://avatars.discourse-cdn.com/v4/letter/s/e5b9ba/32.png) [@sourcedexter](https://discourse.nodered.org/u/sourcedexter)\
**Post date:** [6 August 2018 16:27 UTC](https://discourse.nodered.org/t/multiple-instances-of-a-workflow/2093/6 "2018-08-06T16:27:12Z")

</div>

Alright, i'll design the flow accordingly. Thanks!

---

<div class="post-metadata">

**Author:** ![swapnil\_satpathy](https://avatars.discourse-cdn.com/v4/letter/s/b38774/32.png) [@swapnil\_satpathy](https://discourse.nodered.org/u/swapnil_satpathy)\
**Post date:** [14 June 2022 04:50 UTC](https://discourse.nodered.org/t/multiple-instances-of-a-workflow/2093/7 "2022-06-14T04:50:15Z")

</div>

Hi @knolleary , can you please help me with how to handle this scenario. I have a scenario in which for the first http request, I am getting a shipment number which I have to store as a flow variable since it has to be part of the url in another http request in the same flow. Can you please guide me, how to store the state i.e this flow variable per user, so that I can have multiple instances of the same flow every time the flow is triggered?

---

<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:** [14 June 2022 06:59 UTC](https://discourse.nodered.org/t/multiple-instances-of-a-workflow/2093/8 "2022-06-14T06:59:21Z")

</div>

See duplicate thread. Closing here.

> [@Multiple Instances of a workflow - flow variable](https://discourse.nodered.org/t/multiple-instances-of-a-workflow-flow-variable/63889):
>
> Hi .can you please help me with how to handle this scenario. I have a scenario in which for the first http request, I am getting a shipment number which I have to store as a flow variable since it has to be part of the url in another http request in the same flow. Can you please guide me, how to store the state i.e this flow variable per user, so that I can have multiple instances of the same flow every time the flow is triggered? Presently what is happening is if i trigger the flow, this flow v…

---

<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:** [14 June 2022 06:59 UTC](https://discourse.nodered.org/t/multiple-instances-of-a-workflow/2093/9 "2022-06-14T06:59:26Z")

</div>


