Hello community,
I’m currently working with Camunda 8 using the Spring Boot SDK (version 8.7.8) and encountering an issue regarding task availability timing.
Here’s the behavior I’m observing:
- I start a process instance programmatically.
- Immediately after that, I query for user tasks using
newUserTaskQuery(). - The result is empty (i.e., zero tasks found), although I expect one active user task.
- If I wait for a few seconds (e.g., 5 seconds) and retry the same query, the expected task appears.
This makes me think that the Camunda engine needs some time to create and expose the user task due to asynchronous execution. However, I’m not sure what’s the best way to reliably detect when the user task is ready, especially when trying to implement automation or integration tests.
My questions:
- Is this behavior expected due to async behavior in Zeebe?
- What is the recommended approach to wait for or be notified when a user task becomes available after starting a process?
- Is there a way to get a kind of “acknowledgment” that the task was created or to hook into that event?
Any insights or best practices would be greatly appreciated.
Thank you!
