Where does ZeebeWorker code execute?

The architecture document states that Zeebe brokers do not execute application code.

In a spring boot microservice, we mark the application code with @ZeebeWorker annotation to define a task type. These tasks are then referred in the bpmn workflow diagram. During startup, the microservice connects with the zeebe cluster to register the task types.

When the workflow is executed to start a process instance, where does the @ZeebeWorker code execute? If it executes inside the microservice jvm then how do we achieve horizontal scaling for bpmn service tasks implementations.

Thanks.

Hi @JGeek ,

please have a look at the following docs: Job workers | Camunda 8 Docs

The job worker is executed in the app that contains the worker. So, your Spring Boot application (i.e. your microservice).

The process itself is executed in the workflow engine.

There is a good blog post here: Writing Good Workers For Camunda Cloud | by Bernd Rücker | berndruecker

In general, you can scale your workers by setting up more instances of it. If you have a JVM app then start more instances of it. If you run a Docker image then start another instance. In a production environment, you may use K8s to scale your workers.

Best regards,
Philipp

1 Like

Ok I understand. Thanks for the links I will go through them.

Given that ZeebeWorker code executes in our jvm, what would be the use cases for scaling the zeebe brokers? Would that be just when there are large number of concurrent workflow executions?

Thanks

Yes, kind of. If you have high throughput (i.e. high number of active process instances, or a high number of jobs or concurrent activities in general) then you want to have a bigger cluster of brokers.

1 Like