# Camunda unexpectedly finishes process in the middle

**URL:** <https://forum.camunda.io/t/camunda-unexpectedly-finishes-process-in-the-middle/24352>\
**Category:** Discussion & Questions\
**Tags:** process-engine\
**Created:** [December 14, 2020, 9:14am UTC](https://forum.camunda.io/t/camunda-unexpectedly-finishes-process-in-the-middle/24352 "2020-12-14T09:14:32Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vladimir](https://forum.camunda.io/user_avatar/forum.camunda.io/vladimir/32/7888_2.png) [@Vladimir](https://forum.camunda.io/u/Vladimir)\
**Post date:** [December 14, 2020, 9:14am UTC](https://forum.camunda.io/t/camunda-unexpectedly-finishes-process-in-the-middle/24352/1 "2020-12-14T09:14:32Z")

</div>

Hello, guys! Hope you are well!

I just faced with very unpleasant situation:

1. I have a process definition with a few external tasks, gateways, timers and a few user tasks;
2. Initially it works fine, but I noticed that from time to time Camunda finish process in the middle;

For example process may stops after:

1. user task 1;
2. user task2;

 ![image](https://forum.camunda.io/uploads/default/original/2X/b/bb1081ce6c679c028db94dd50ae13f9c28976625.png)

And I completely do not understand what is going on. Maybe some of you faced with such a problem or has any ideas?

---

<div class="post-metadata">

**Author:** ![Niall](https://forum.camunda.io/user_avatar/forum.camunda.io/niall/32/15333_2.png) [@Niall](https://forum.camunda.io/u/Niall)\
**Post date:** [December 14, 2020, 9:42am UTC](https://forum.camunda.io/t/camunda-unexpectedly-finishes-process-in-the-middle/24352/2 "2020-12-14T09:42:23Z")

</div>

Can you upload the process model?  
When you say “stops” can you describe that in more detail?

---

<div class="post-metadata">

**Author:** ![Vladimir](https://forum.camunda.io/user_avatar/forum.camunda.io/vladimir/32/7888_2.png) [@Vladimir](https://forum.camunda.io/u/Vladimir)\
**Post date:** [December 14, 2020, 12:16pm UTC](https://forum.camunda.io/t/camunda-unexpectedly-finishes-process-in-the-middle/24352/3 "2020-12-14T12:16:21Z")

</div>

Hello, Niall!

This is the real workflow I used. I replaced meaningful names with some stubs.  
[for\_camunda\_forum.bpmn](https://forum.camunda.io/uploads/short-url/q0vjE3xtxK96PJ8KOv6VW47l4yG.bpmn) (25.8 KB)

When I say “stops”. I mean that process finishes unexpectedly in the middle of flow. F.e. after the first user task.

---

<div class="post-metadata">

**Author:** ![Niall](https://forum.camunda.io/user_avatar/forum.camunda.io/niall/32/15333_2.png) [@Niall](https://forum.camunda.io/u/Niall)\
**Post date:** [December 14, 2020, 12:18pm UTC](https://forum.camunda.io/t/camunda-unexpectedly-finishes-process-in-the-middle/24352/4 "2020-12-14T12:18:58Z")

</div>

Is there any indication form the logs about what might be going wrong?  
What does the history of the process does it say the process was cancelled?

---

<div class="post-metadata">

**Author:** ![Vladimir](https://forum.camunda.io/user_avatar/forum.camunda.io/vladimir/32/7888_2.png) [@Vladimir](https://forum.camunda.io/u/Vladimir)\
**Post date:** [December 14, 2020, 12:24pm UTC](https://forum.camunda.io/t/camunda-unexpectedly-finishes-process-in-the-middle/24352/5 "2020-12-14T12:24:55Z")

</div>

I completely forgot to say that “mock-task-topic” handler wait for 1.5 minutes and then complete an external task.

There was no errors in Camunda logs.  
And I am investigating history right now (It’s quite tough).

---

<div class="post-metadata">

**Author:** ![Vladimir](https://forum.camunda.io/user_avatar/forum.camunda.io/vladimir/32/7888_2.png) [@Vladimir](https://forum.camunda.io/u/Vladimir)\
**Post date:** [December 14, 2020, 12:41pm UTC](https://forum.camunda.io/t/camunda-unexpectedly-finishes-process-in-the-middle/24352/6 "2020-12-14T12:41:32Z")

</div>

Niall, looks like everything fine with Camunda except timers.

I checked history and process instance completed correctly.

But there are 2 external tasks in my process definition with bounded timer events. In both cases I put PT1M (1 minute) duration on it. And external task waits for 1.5 minutes before complete. And it work fine sometimes. But looks like sometimes timers does not work.

I have read that 1 minute and less timers may cause some problems. Is it true?

If not, then issue with mu external task handler.

---

<div class="post-metadata">

**Author:** ![Niall](https://forum.camunda.io/user_avatar/forum.camunda.io/niall/32/15333_2.png) [@Niall](https://forum.camunda.io/u/Niall)\
**Post date:** [December 14, 2020, 12:42pm UTC](https://forum.camunda.io/t/camunda-unexpectedly-finishes-process-in-the-middle/24352/7 "2020-12-14T12:42:52Z")

</div>

> [@Vladimir](#):
>
> But looks like sometimes timers does not work.

Can you explain what exactly doesn’t work - do they not execute at all or do the execute too late?

---

<div class="post-metadata">

**Author:** ![Vladimir](https://forum.camunda.io/user_avatar/forum.camunda.io/vladimir/32/7888_2.png) [@Vladimir](https://forum.camunda.io/u/Vladimir)\
**Post date:** [December 14, 2020, 12:50pm UTC](https://forum.camunda.io/t/camunda-unexpectedly-finishes-process-in-the-middle/24352/8 "2020-12-14T12:50:43Z")

</div>

I have the following situation:

 ![image](https://forum.camunda.io/uploads/default/original/2X/7/736a8d9c1570cb6431c610fa666b337ffb9beeab.png)

According to image I always have to go to UserTask\_1.

But from time to time process instance

1. goes to UserTask\_1. In this case in act\_hi\_actinst table I see BoundaryTimerEvent;

2. sometimes it goes to another branch. In this case in act\_hi\_actinst no BoundaryTimerEvent exists.

---

<div class="post-metadata">

**Author:** ![Niall](https://forum.camunda.io/user_avatar/forum.camunda.io/niall/32/15333_2.png) [@Niall](https://forum.camunda.io/u/Niall)\
**Post date:** [December 14, 2020, 1:11pm UTC](https://forum.camunda.io/t/camunda-unexpectedly-finishes-process-in-the-middle/24352/9 "2020-12-14T13:11:15Z")

</div>

Ok i understand the problem and i know what you need you do.  
The issue is with the frequency at which your job executor is getting jobs.  
Each time a timer is created in the database it has a date which it will be executed - the job executor periodically checks for jobs and if it find them it executed them if not it waits for a set time before checking again. So it seems like you need to have the job executor poll for jobs more often.

You should check out this [great blog post](https://camunda.com/blog/2019/10/job-executor-what-is-going-on-in-my-process-engine/) written by @thorben for more information.

---

<div class="post-metadata">

**Author:** ![Vladimir](https://forum.camunda.io/user_avatar/forum.camunda.io/vladimir/32/7888_2.png) [@Vladimir](https://forum.camunda.io/u/Vladimir)\
**Post date:** [December 14, 2020, 1:18pm UTC](https://forum.camunda.io/t/camunda-unexpectedly-finishes-process-in-the-middle/24352/10 "2020-12-14T13:18:54Z")

</div>

Got it. Thank you for the advice, Niall. I will check it.

---

<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:** [January 30, 2024, 12:48pm UTC](https://forum.camunda.io/t/camunda-unexpectedly-finishes-process-in-the-middle/24352/11 "2024-01-30T12:48:19Z")

</div>

Closed on January 30, 2024, 12:48pm UTC


