How to notify a custom tasklist app of a timer completing a user task

Hello community,
I’m developing a custom tasklist application in React with the requirement of avoid using the Tasklist REST API so I’ve chosen to follow the " Decoupled Job Completion pattern" using the gRPC Zeebe API.

My backend creats a job worker that listens to all the jobs for the tasks of type ‘io.camunda.zeebe:userTask’, saves the info in a mongodb and “forward” the job.

The React frontend will retrieve the information from this mongodb in order to show what are the tasks available.

If a user clicks a button on the UI of the task, the backend will complete the corresponding job via the Zeebe gRPC API.

This works great when it’s a user that completes a task because there will be an interaction with the backend that will take care of both completing the job and updating the mongoDB marking the task as completed.

This architecture stops working if the tasks are completed by timers or other events because my backend won’t be aware of that completion.

So the question is, is there a way to be notified of the completion of a task through the Zeebe API ?

Thank you

Best regards

Hey @mfmanca, thanks for reaching out :slight_smile:

Currently there is no mechanism on Zeebe to notify you about task state changes on C8, what you can do is to use exporters rather than using job workers - check here Exporters | Camunda 8 Docs

In this way you would get all the records exported from Zeebe and you could handle a good way to import them on your mongoDB (so when a task is completed you would receive this task on the exporter and then you update your MongoDB).

Another good thing to know is that we know that this is not exactly the best experience on being notified about tasks and we are already working on User Task Listeners (check here: [Root epic] User Task Listeners · Issue #308 · camunda/issues · GitHub) that will make this experience better and tasks life cycle management easier.

I hope that this helps, let me know if I can assist you with more details.

1 Like

Thank you,
while waiting for the release of the listeners, we will implement an exporter that will handle all the events related to the creation or completion of user tasks.
Best regards

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.