Zeebe- Dynamically determine the tasks to be executed in a workflow

Hi Zeebe Community,

In a workflow, I would like to execute a step ‘n’ times based on the response returned by the previous step.

Let’s assume my workflow has 2 tasks.

Start → Task1 → Task 2 → End

‘Task1’ is handled by a worker and returns a payload containing list of ‘n’ objects.

After Task1 completes, I would like to execute ‘n’ number of tasks of type ‘Task2’ (sequentially or concurrebt). Is it possible to model this behavior in Zeebe?

Hi @Ajay,

first, welcome to the community :tada:

After Task1 completes, I would like to execute ‘n’ number of tasks of type ‘Task2’ (sequentially or concurrebt). Is it possible to model this behavior in Zeebe?

Yes! I see two options:

  • model a loop around the task (i.e. exclusive gateway using a loop counter)
  • mark the task as multi-instance, sequential or parallel (i.e. the input collection defines the iterations)

Does this help you?
How many iterations do you expect?

Best regards,
Philipp

1 Like

Hi Philipp,

Thank you for your quick response!

The second option helps me. I am trying to implement the second option(using multi-instance). I will let you know if i come across any issues.