How zeebe do the work distribution

Hi Experts,

i’m new to the zeebe and i recently start to study zeebe but still not fully understand how zeebe do the work distribution among microservices. Assuming that i have a workflow (order placed–>collect money–>fetch items–>ship parcel–>order delivered) deploy on my workflow engine and i have several microservices to handle different jobs, like the payment service will responsible for that “collect money” task. For each microservices it will embed an zeebe client for the communication with workflow engine. i implemented the example for Golang client but i feel that from the client prospective i need to call the workflow engine with specific task name and finish it manually, which means is not a automatic process? i thought the ideal way should be like when one task has been finished, the workflow engine will have some notification or event to other microserive so that it can pick up the task and finish job? i think it might because i’m not fully understand the mechanism behind zeebe for how it works with external microservices. so my question is:
1). how the miscroservice know it should start to finish the task? for example how can my “payment” service know when it should go to pick the task from zeebe and finish it?
2). i notice that some article mentioned that the microservice can subscribe the task in workflow engine. but i didn’t see any method in Golang client to support that. can you please provide more information about how publish-subscribe works in zeebe?
3). Is there any recommend way for the communication or work distribution between zeebe and microserivce that i can follow?

Thank you.

The Zeebe client polls the broker for work under the hood.

2 Likes

As @jwulf mention, Zeebe uses a pub/sub mechanism to interact with Workers. These workers are in charge of connecting to your Microservices. Workers are in charge of going to the cluster to request jobs to work on based on the types (Service Task type in the BPMN model). Take a look at the Zeebe Client lib in Go -> https://github.com/zeebe-io/zeebe-get-started-go-client Also in the Docs: https://docs.zeebe.io/go-client/get-started.html#work-on-a-task

HTH

1 Like

thx @jwulf

1 Like

More info: https://github.com/jwulf/zeebe-client-node-js/blob/guide/guide/content/introduction/not-rest.md

2 Likes