Creating dynamic tasks


I have integrated flowable into my current project and everything’s working great. Now I am stuck into creating tasks dynamically.

So the requirement is user submits the request and it goes to head of the department. The head will choose which are the impacted units(departments) for this request. There could be n impacted units. The number of units he chooses is impacted by this request and submits, a parallel task will be created for all those corresponding unit heads and unit heads will work in parallel to get their task completed. Also when task assigned to impacted unit head, even he can add more impacted units and task will be created for that impacted unit head as well.

Please suggest me a nice way how do I design workflow and create parallel set of tasks dynamically depending on head chooses impacted units.

Awaiting for a response.
Thanks in advance.


Awaiting for a quick response please. Thanks.

Hi Amit,

In the case when the process is stable I would suggest to:

Create list of “impacted units(departments)” and use multiinstance user task to itterate through the list and create tasks (

In the case of ad-hoc process, I would create a case for a user request and add tasks to this case. AdHoc case tasks implementation is


1 Like


You do create a task and adding in yout process instance:

Task t = taskService.newTask(“new task”);
List listTasks = taskService.createTaskQuery().list();

Thank you so much for the reply.

I have created a multiinstance user task. The tasks are getting created for n users but the value of assignee in table ACT_RU_TASK is null.

List<String> impactedUnitHead = new ArrayList<>();
variables.put("usersCount", 3);
variables.put("impactedUnitHead", impactedUnitHead);

In the flowable designer properties panel, I have set

Loop Cardinality -> 3
Collection -> ${impactedUnitHead}

So 3 tasks got created in table ACT_RU_TASK but assignees were null. I expected jason, sharon and roger to be the assignees of those tasks.

There are two other properties as well for Multi Instance tab

1. Element variable
2. Completion condition

Please guide me through this.

Awaiting for you response. Thanks in advance.


you can find answers in the jUnit test.



Thank you very much for your solution. Now just one point that I am wondering how can I work that out. I am being able to create n tasks dynamically but once these tasks get assigned to respective users, even they can create tasks for other users. I tried to create new task

Task gonzoTask = taskService.newTask();

This does create new task but without process instance id and lot of fields null. This task is not a subtask of the multiinstance dynamic n task created above. Infact it is parallel task to the multiinstance dynamic tasks. User forgot to create tasks for these at one go so the parallel multiinstance tasks assignees can add new task parallel to them.

Please help me in this. Awaiting for your quick response.

Thank you so much for your guidance.

Please help. Awaiting for a response.


1 Like

Thank you so much. It worked