# User task after service task was skipped

**URL:** <https://forum.camunda.io/t/user-task-after-service-task-was-skipped/48917>\
**Category:** Discussion & Questions\
**Tags:** spring-boot-starter, zeebe\
**Created:** [November 21, 2023, 3:31pm UTC](https://forum.camunda.io/t/user-task-after-service-task-was-skipped/48917 "2023-11-21T15:31:05Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![dd\_ss](https://forum.camunda.io/user_avatar/forum.camunda.io/dd_ss/32/27605_2.png) [@dd\_ss](https://forum.camunda.io/u/dd_ss)\
**Post date:** [November 21, 2023, 3:31pm UTC](https://forum.camunda.io/t/user-task-after-service-task-was-skipped/48917/1 "2023-11-21T15:31:05Z")

</div>

Hello, I’m having an issue with Camunda self-managed.  
 ![image](https://forum.camunda.io/uploads/default/original/3X/a/a/aa79a698d75f74e4f9ff2a52c3442f8ba047b210.png)

I have a service task followed by a user task. After completing the service task, Camunda skips the user task, and I encounter an error at the gateway. How can I solve this? I use the Zeebe client to complete tasks.

```auto
@JobWorker(type = "validateForm")
  public void validateForm(final JobClient client, final ActivatedJob job) {
    logJob(job, "validateForm");

    var variables = job.getVariablesAsType(HolderVariables.class);
    service.checkOpenAccount(variables);

    client.newCompleteCommand(job.getKey()).send().join();
  }

```

---

<div class="post-metadata">

**Author:** ![Hafflgav](https://forum.camunda.io/user_avatar/forum.camunda.io/hafflgav/32/21343_2.png) [@Hafflgav](https://forum.camunda.io/u/Hafflgav)\
**Post date:** [November 21, 2023, 3:47pm UTC](https://forum.camunda.io/t/user-task-after-service-task-was-skipped/48917/2 "2023-11-21T15:47:48Z")

</div>

Hey @dd_ss 👋  
Welcome to the Camunda Community 🥳

Can you attach your BPMN model by any chance?  
Usually a User Task should never be skipped. 🤔 Did you attach any kind of form?

Best,  
Thomas

---

<div class="post-metadata">

**Author:** ![dd\_ss](https://forum.camunda.io/user_avatar/forum.camunda.io/dd_ss/32/27605_2.png) [@dd\_ss](https://forum.camunda.io/u/dd_ss)\
**Post date:** [November 21, 2023, 6:43pm UTC](https://forum.camunda.io/t/user-task-after-service-task-was-skipped/48917/3 "2023-11-21T18:43:29Z")

</div>

Here is the xml.

[businessRelationsGoal.bpmn](https://forum.camunda.io/uploads/short-url/67LmRngK5gptUWfFKnCHQyVlDKc.bpmn) (14.4 KB)

 ![image](https://forum.camunda.io/uploads/default/original/3X/a/9/a95137b4568fc6d0de841ee130ddf64468397e8c.png)

and process metadata:

{  
“flowNodeId”: “usertask\_approve\_form”,  
“flowNodeType”: “USER\_TASK”,  
“startDate”: “2023-11-21 16:51:28”,  
“endDate”: “2023-11-21 16:51:28”,  
“calledProcessDefinitionName”: null,  
“calledDecisionDefinitionName”: null,  
“eventId”: “4503599633316541\_4503599633316603”,  
“jobType”: “io.camunda.zeebe:userTask”,  
“jobRetries”: 1,  
“jobWorker”: “openAccount”,  
“jobDeadline”: “2023-11-21 16:56:28”,  
“jobCustomHeaders”: {  
“io.camunda.zeebe:assignee”: “username”  
},  
“messageName”: null,  
“correlationKey”: null,  
“incidentErrorType”: null,  
“incidentErrorMessage”: null,  
“flowNodeInstanceKey”: “4503599633316603”,  
“calledProcessInstanceKey”: null,  
“calledDecisionInstanceKey”: null  
}.

I don’t understand how a user task was skipped if I didn’t do anything.

---

<div class="post-metadata">

**Author:** ![Hafflgav](https://forum.camunda.io/user_avatar/forum.camunda.io/hafflgav/32/21343_2.png) [@Hafflgav](https://forum.camunda.io/u/Hafflgav)\
**Post date:** [November 22, 2023, 8:02am UTC](https://forum.camunda.io/t/user-task-after-service-task-was-skipped/48917/4 "2023-11-22T08:02:22Z")

</div>

Thanks for sharing all of this information.  
Let’s try how the behaviour differs when adding a form to the user task which causes a problem. I have already added one to the BPMN model. Here is the updated version:

[businessRelationsGoal.bpmn](https://forum.camunda.io/uploads/short-url/8cBgBjb7ubWyQuLykMLyQ3Lz3U1.bpmn) (15.2 KB)  
[approved-form.form](https://forum.camunda.io/uploads/short-url/i9BCIpV6kJ4CYOylG4G9lKB9c5j.form) (710 Bytes)

Maybe that already solves your issue. 🤔  
Let me know if it changes something.

Best,  
Thomas

---

<div class="post-metadata">

**Author:** ![dd\_ss](https://forum.camunda.io/user_avatar/forum.camunda.io/dd_ss/32/27605_2.png) [@dd\_ss](https://forum.camunda.io/u/dd_ss)\
**Post date:** [November 22, 2023, 12:36pm UTC](https://forum.camunda.io/t/user-task-after-service-task-was-skipped/48917/5 "2023-11-22T12:36:57Z")

</div>

Thank you for all your help. I found a solution to this problem. The first user task should have been automatically solved using Zeebe, but this code finishes all user tasks, not just one by name.

```auto
zeebeClient.newWorker()
    .jobType("io.camunda.zeebe:userTask")
    .handler((jobClient, job) -> {
        jobClient.newCompleteCommand(job)
            .send()
            .join();
    })
    .name("openAccount")
    .open();

```

Now I am using the Tasklist client to complete the user task, and that has solved my problem.

---

<div class="post-metadata">

**Author:** ![Hafflgav](https://forum.camunda.io/user_avatar/forum.camunda.io/hafflgav/32/21343_2.png) [@Hafflgav](https://forum.camunda.io/u/Hafflgav)\
**Post date:** [November 22, 2023, 2:10pm UTC](https://forum.camunda.io/t/user-task-after-service-task-was-skipped/48917/6 "2023-11-22T14:10:18Z")

</div>

Oh, I see. 😃  
Thanks for posting the solution to your problem.  
P.S.: If you user workers to complete your user tasks, rather make it a service task right away. 🙂

---

<div class="post-metadata">

**Author:** ![system](https://forum.camunda.io/uploads/default/original/3X/5/8/58d50142eacca605d35cb1ef9e6b86ae85f49436.png) [@system](https://forum.camunda.io/u/system)\
**Post date:** [November 29, 2023, 2:10pm UTC](https://forum.camunda.io/t/user-task-after-service-task-was-skipped/48917/7 "2023-11-29T14:10:27Z")

</div>

Closed on November 29, 2023, 2:10pm UTC

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