# Concurrency and Throttling in workflows

**URL:** <https://community.weweb.io/t/concurrency-and-throttling-in-workflows/2727>\
**Category:** How do I?\
**Tags:** workflows\
**Created:** [May 18, 2023, 6:12am UTC](https://community.weweb.io/t/concurrency-and-throttling-in-workflows/2727 "2023-05-18T06:12:58Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![tomlagom](https://avatars.discourse-cdn.com/v4/letter/t/3be4f8/32.png) [@tomlagom](https://community.weweb.io/u/tomlagom)\
**Post date:** [May 18, 2023, 6:12am UTC](https://community.weweb.io/t/concurrency-and-throttling-in-workflows/2727/1 "2023-05-18T06:12:58Z")

</div>

What is the best way to manage concurrency and throttling in workflows.  
I know that I can use a var as a bool, change it at the beginning and at the end of the workflow. This is pretty manual and prone to errors.

The use case, for example is a submit form. User may press ‘enter’ more than one in a 1second period.

Is there any better or more sophisticated way to do it?

---

<div class="post-metadata">

**Author:** ![aurelie](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/aurelie/32/13249_2.png) [@aurelie](https://community.weweb.io/u/aurelie)\
**Post date:** [May 18, 2023, 12:34pm UTC](https://community.weweb.io/t/concurrency-and-throttling-in-workflows/2727/2 "2023-05-18T12:34:28Z")

</div>

What we usually do is to change a variable at the start of the workflow, and use it to disabled the button or the form (you can even display a loader)

---

<div class="post-metadata">

**Author:** ![tomlagom](https://avatars.discourse-cdn.com/v4/letter/t/3be4f8/32.png) [@tomlagom](https://community.weweb.io/u/tomlagom)\
**Post date:** [May 18, 2023, 12:37pm UTC](https://community.weweb.io/t/concurrency-and-throttling-in-workflows/2727/3 "2023-05-18T12:37:58Z")

</div>

then at the End or Error of the workflow you have to change it again, right?

---

<div class="post-metadata">

**Author:** ![aurelie](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/aurelie/32/13249_2.png) [@aurelie](https://community.weweb.io/u/aurelie)\
**Post date:** [May 18, 2023, 12:47pm UTC](https://community.weweb.io/t/concurrency-and-throttling-in-workflows/2727/4 "2023-05-18T12:47:11Z")

</div>

Yes, thats exactly how you do it. Its hard to find something generic, because every form or action has their own logic (you may want to block several actions for example).

---

<div class="post-metadata">

**Author:** ![tomlagom](https://avatars.discourse-cdn.com/v4/letter/t/3be4f8/32.png) [@tomlagom](https://community.weweb.io/u/tomlagom)\
**Post date:** [May 18, 2023, 3:27pm UTC](https://community.weweb.io/t/concurrency-and-throttling-in-workflows/2727/5 "2023-05-18T15:27:25Z")

</div>

Then, this would be a feature request to add a concurrency parameter in workflows.

I imagine a parameter in workflows that say: **“Block concurrent requests to this workflow” yes/no.**

This way I don’t have to be _changing_ and _reseting_ variables in every workflow that do stuff outside of the front-end. In multiple parts of a workflow

---

<div class="post-metadata">

**Author:** ![tomlagom](https://avatars.discourse-cdn.com/v4/letter/t/3be4f8/32.png) [@tomlagom](https://community.weweb.io/u/tomlagom)\
**Post date:** [May 18, 2023, 3:28pm UTC](https://community.weweb.io/t/concurrency-and-throttling-in-workflows/2727/6 "2023-05-18T15:28:40Z")

</div>

Alternatively, add a native way to see if a workflow is running or not.
