I want to get a list of all User Tasks right after they are created. Currently, we are using polling, which isn’t a good approach for our use case.
We are on Camunda 8.6 and migrating to 8.9 shortly. What is the best practice to get real-time notifications or events when a User Task is created without polling the Tasklist API?
Appreciate any advice!
For real-time User Task notifications in Camunda 8, you should use User Task Listeners instead of polling the Tasklist API. I found the following relevant resources:
A good practice for this kind of requirement is to avoid relying on polling Tasklist and instead build an event-driven approach with your own user task store.
From Camunda 8.8, you can use User Task Listeners, which allow you to react to user task lifecycle events (such as created, assigned, completed ..etc). These listeners can be configured per process or globally, giving you full coverage of all user tasks in your system.
Conceptually, they behave similarly to job workers, you implement your own handler logic and react to the events emitted by the engine.
With this approach, you can:
Persist user tasks in your own storage for fast retrieval
Push events into a streaming system like Kafka for downstream processing
Or even trigger real-time notifications to your frontend via WebSocket or similar mechanisms