Hi, im trying to complete a userTask from my spring application. I’m running Zeebe 8.7 and connect to it using zeebe-client-java 8.7.
My task exists, i can see it in optimize:
{
"flowNodeType": "USER_TASK",
"flowNodeId": "OP00XT001_Sample_Task",
"startDate": "2025-06-11 11:45:45",
"eventId": "2251799813686192_2251799813686196",
"jobType": "io.camunda.zeebe:userTask",
"jobRetries": 1,
"jobWorker": "",
"jobCustomHeaders": {},
"variables": {},
"candidateGroups": [],
"candidateUsers": [],
"endDate": null,
"jobDeadline": null,
"incidentErrorType": null,
"incidentErrorMessage": null,
"flowNodeInstanceKey": "2251799813686196"
}
Now i want to coplete it through my custom app:
@PostMapping(value = "/task/{taskId}/complete")
public void completeTask(@PathVariable("taskId") Long jobKey) throws ExecutionException, InterruptedException {
zeebeClient.newUserTaskCompleteCommand(jobKey)
.variables(Map.of())
.send().get();
System.out.println("Task " + jobKey + " completed.");
}
However it seems like the engine can not find this task to complete:
io.camunda.zeebe.client.api.command.ProblemException: Failed with code 404: 'Not Found'. Details: 'class ProblemDetail {
type: about:blank
title: NOT_FOUND
status: 404
detail: Command 'COMPLETE' rejected with code 'NOT_FOUND': Expected to complete user task with key '2251799813686196', but no such user task was found
instance: /v2/user-tasks/2251799813686196/completion
}'
This makes no sens for me, as i can clearly see the user task in the operate.
I know the library is properly configured, as i can start and interact with the process through it, the only missing piece is to complete user tasks. Any ideas why is that?