# Auto Assign User

**URL:** <https://forum.flowable.org/t/auto-assign-user/4146>\
**Category:** Flowable Engine\
**Created:** [July 8, 2019, 3:27pm UTC](https://forum.flowable.org/t/auto-assign-user/4146 "2019-07-08T15:27:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![railrhoad](https://avatars.discourse-cdn.com/v4/letter/r/9fc29f/32.png) [@railrhoad](https://forum.flowable.org/u/railrhoad)\
**Post date:** [July 8, 2019, 3:27pm UTC](https://forum.flowable.org/t/auto-assign-user/4146/1 "2019-07-08T15:27:21Z")

</div>

In our flows, we’d like to implement a “next available user” feature. We have some code to help determine who is the most eligible user from a group to assign the task to, but we’re not sure where to call it from from within the engine.

Most of the calls in the engine for setAssignee() are done when parsing the model json (when defining the process model). We’d like to invoke this code when the task is being instantiated instead.

Any help is appreciated!

---

<div class="post-metadata">

**Author:** ![PHH](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/phh/32/94_2.png) [@PHH](https://forum.flowable.org/u/PHH)\
**Post date:** [July 8, 2019, 3:54pm UTC](https://forum.flowable.org/t/auto-assign-user/4146/2 "2019-07-08T15:54:27Z")

</div>

You can put the logic into a task listener that sets the assignee on creation of a task. Is that the kind of thing you’re looking for?

Cheers  
Paul.

---

<div class="post-metadata">

**Author:** ![PHH](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/phh/32/94_2.png) [@PHH](https://forum.flowable.org/u/PHH)\
**Post date:** [July 8, 2019, 3:56pm UTC](https://forum.flowable.org/t/auto-assign-user/4146/3 "2019-07-08T15:56:30Z")

</div>

You can also do it as a listener on task completion, where you then look for the next appropriate task to assign to the user who just completed the task. Kind of feed a next appropriate task for each user, rather than assign tasks to a given person that might build up.

Cheers  
Paul.

---

<div class="post-metadata">

**Author:** ![railrhoad](https://avatars.discourse-cdn.com/v4/letter/r/9fc29f/32.png) [@railrhoad](https://forum.flowable.org/u/railrhoad)\
**Post date:** [July 8, 2019, 4:07pm UTC](https://forum.flowable.org/t/auto-assign-user/4146/4 "2019-07-08T16:07:03Z")

</div>

Yep, that’s what we’re looking for. Thanks, we’ll investigate those listeners.
