# Tasks getting duplicated

**URL:** <https://forum.flowable.org/t/tasks-getting-duplicated/6639>\
**Category:** Flowable Engine\
**Created:** [September 1, 2020, 8:42am UTC](https://forum.flowable.org/t/tasks-getting-duplicated/6639 "2020-09-01T08:42:29Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![fiki574](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/fiki574/32/1675_2.png) [@fiki574](https://forum.flowable.org/u/fiki574)\
**Post date:** [September 1, 2020, 8:42am UTC](https://forum.flowable.org/t/tasks-getting-duplicated/6639/1 "2020-09-01T08:42:29Z")

</div>

Hey, I have the following model:

![36c3bebd29b6032490cf9d2d1e0d572c343ce3cb_2_1035x330](https://canada1.discourse-cdn.com/flex035/uploads/flowable/original/2X/9/9ed55115620a0ab8e13563e1a389ca21e6a837b4.png)

All good, it gets to where it needs to be:

 ![c9131c33ac7b37f08231270c78c78f5d399e5629_2_1035x340](https://canada1.discourse-cdn.com/flex035/uploads/flowable/original/2X/a/ae46c0b47921021fcc936008bdedac28300a3327.png)

However, three instances of the same task with slightly different ID are created, why?

 ![image](https://canada1.discourse-cdn.com/flex035/uploads/flowable/original/2X/2/2fe5669f0962fd9d107fb079fe45916af7e17b93.png)

---

<div class="post-metadata">

**Author:** ![filiphr](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/filiphr/32/315_2.png) [@filiphr](https://forum.flowable.org/u/filiphr)\
**Post date:** [September 1, 2020, 4:31pm UTC](https://forum.flowable.org/t/tasks-getting-duplicated/6639/2 "2020-09-01T16:31:19Z")

</div>

Hey @fiki574,

Three instances are created because you have 3 flows going into the task.

After your first script task you have a parallel gateway that will create 3 new tokens. From those new tokens you go to an exclusive gateway which then goes to the user task.

You will need to have a parallel gateway before the user task and have 2 new exclusive gateways that will merge the flows from the top and bottom exclusive gateway with the appropriate HTTP tasks on their lines.

Cheers,  
Filip

---

<div class="post-metadata">

**Author:** ![fiki574](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/fiki574/32/1675_2.png) [@fiki574](https://forum.flowable.org/u/fiki574)\
**Post date:** [September 2, 2020, 6:43am UTC](https://forum.flowable.org/t/tasks-getting-duplicated/6639/3 "2020-09-02T06:43:38Z")

</div>

Hey, thanks for the response.

That’s kinda what I thought. I reconsidered my use case and realized I don’t really need a parallel gateway at all, so I’ve come up with the following model:

 ![image](https://canada1.discourse-cdn.com/flex035/uploads/flowable/original/2X/f/f98484745568c24b56c1138830ee5267cef887f7.png)

This now works as intended, tested all the possible flows, works good and in the end only one user task is created.

Thanks again nonetheless.

---

<div class="post-metadata">

**Author:** ![filiphr](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/filiphr/32/315_2.png) [@filiphr](https://forum.flowable.org/u/filiphr)\
**Post date:** [September 2, 2020, 6:53am UTC](https://forum.flowable.org/t/tasks-getting-duplicated/6639/4 "2020-09-02T06:53:53Z")

</div>

Just for future potential improvements have a look at the [True Parallel Service Task Execution with Flowable](https://blog.flowable.org/2020/08/06/true-parallel-service-task-execution-with-flowable/). From 6.6 it will be possible to execute HTTP Tasks truly in parallel. With your second BPMN model you can’t use that, but with your first and my comment you would be able to do it ;).

---

<div class="post-metadata">

**Author:** ![fiki574](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/fiki574/32/1675_2.png) [@fiki574](https://forum.flowable.org/u/fiki574)\
**Post date:** [September 2, 2020, 6:58am UTC](https://forum.flowable.org/t/tasks-getting-duplicated/6639/5 "2020-09-02T06:58:44Z")

</div>

Sure, thanks for heads up.
