Can't run two service task parallelly?

Hi Team,

I have added two service tasks in parallel gateway and observed that both services are not running in parallel at same time. Once one service task completed then started another.

anyone here have any idea on this ?

parallel-gateway-example.bpmn (4.8 KB)

it may be because thread are not available to execute your service task better if you can check in your service job pool configuration
by default there is 10.

1 more thing this are im synchronous mode or asynchronous

1 Like

Hi @yadav1990,

Camunda 7 has an internal transaction management. In general, each transaction leads to a job, that is executed by a JobExecutor. Parallelism will be resolved to a sequential order. A new job is only started if the process reaches a wait state (i.e., a user-task or a message receive event).
As mentioned by @pinturjs, you can change this behavior by setting the asynchronous before flag for Task 2 and Task 3:


You can read more here:

Thanks @StephanHaarmann and @pinturjs .There was enough thread available in the queue. And I was not looking for asynchronous feature. The meaning of parallel gateway is , to start the services parallelly without waiting for each other.

Hi @yadav1990,

You are correct from the BPMN modeling point of view. When it comes to execute this process, there a many pitfalls where you can fall in, like overwriting variables from the parallel streams and deadlock situations in the database. For this reason, the Camunda engine is very careful and chooses to execute the tasks sequentially if you use the JavaDelegate as Service Task implementation.

It’s a complete different story for user tasks or if you implement your service tasks as external service tasks. Here you will get real parallel execution without further tweaking the process model.

Hope this helps, Ingo

1 Like

@miamoore , may I know why you edited the post?

@StephanHaarmann is she has rights to edit? I can see she was edited my 3 post.

Hi @yadav1990, I am adding tags to older topics and reorganizing categories a bit. I didn’t edit any of the content of your post.

1 Like