Find the appropriate task ID automatically in Camunda

I am using Camunda in a Spring Boot application. How can I start or complete a task using the task ID automatically or find the appropriate task ID in Camunda .

Hello my friend!

To start (claim) or to complete a user task on camunda, first you need to find the userId from current user logged in.

        var userId = execution.getProcessEngineServices()

Then you can claim the task by passing the logged in userId, and the id of the task you want to claim/start. Using this code:

                .claim("yourTaskId", userId);

and to finish, you can complete the task by passing the taskId to the following code below:


If you need to programmatically fetch the taskId that your instance is at at that particular moment, you can use the code below:


i hope this helps!

William Robert Alves