# Stale UserTask cleanup

**URL:** <https://forum.camunda.io/t/stale-usertask-cleanup/68348>\
**Category:** Camunda 8 Topics\
**Tags:** spring-boot-starter, zeebe\
**Created:** [June 29, 2026, 6:47pm UTC](https://forum.camunda.io/t/stale-usertask-cleanup/68348 "2026-06-29T18:47:49Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![theodor-franke](https://forum.camunda.io/user_avatar/forum.camunda.io/theodor-franke/32/33671_2.png) [@theodor-franke](https://forum.camunda.io/u/theodor-franke)\
**Post date:** [June 29, 2026, 6:47pm UTC](https://forum.camunda.io/t/stale-usertask-cleanup/68348/1 "2026-06-29T18:47:49Z")

</div>

Hi,

We are using Camunda 8 in our company and have what we would have expected to be a fairly standard requirement: we need to unassign stale user tasks. By “stale”, we mean user tasks that have been assigned to a user for more than one day.

As far as we can tell, Camunda 8 does not support this natively. To be honest, that is quite surprising. Tracking how long a task has been assigned to someone feels like a basic capability for any orchestration or workflow system, not some exotic edge case.

Our first idea was to implement a scheduled job that periodically queries the Orchestration API, checks for assignments that have become stale, and then unassigns the users from those tasks. However, from what we can see, Zeebe does not store or expose the timestamp of when a user task was assigned. That makes this much harder than it should be.

The only workaround we currently see is to set the task’s `dueDate` to the assignment timestamp, or to the timestamp at which the assignment should be considered stale, at the moment the task is assigned. We could then query this date through the Orchestration API.

We do not like this approach. It misuses `dueDate` for something it was clearly not intended for, and it adds yet another transaction during task assignment, which is already uncomfortably slow.

So, are we missing something obvious here? Is there a cleaner or simpler way to implement this requirement in Camunda 8, or is this really another feature we have to build around ourselves?

The more we work with Camunda 8, the more it feels like some fairly fundamental workflow and task-management capabilities are either missing or only half-finished.

---

<div class="post-metadata">

**Author:** ![zee-bot](https://forum.camunda.io/user_avatar/forum.camunda.io/zee-bot/32/32886_2.png) [@zee-bot](https://forum.camunda.io/u/zee-bot)\
**Post date:** [June 29, 2026, 6:49pm UTC](https://forum.camunda.io/t/stale-usertask-cleanup/68348/2 "2026-06-29T18:49:15Z")

</div>

You’re correct that Camunda 8 doesn’t natively support automatic cleanup of stale user tasks based on assignment timestamps, and the Orchestration API doesn’t expose assignment timestamps for filtering. I found the following relevant resources:

- [User task lifecycle documentation](https://docs.camunda.io/docs/apis-tools/frontend-development/task-applications/user-task-lifecycle/) - explains that Optimize only tracks assigned/unassigned time, more granular tracking requires custom action values
- [Search user tasks API](https://docs.camunda.io/docs/apis-tools/orchestration-cluster-api-rest/specifications/search-user-tasks/) - shows how to query assigned tasks but doesn’t include assignment timestamp filtering
- [Unassign user task API](https://docs.camunda.io/docs/apis-tools/orchestration-cluster-api-rest/specifications/unassign-user-task/) - the endpoint you’d use for programmatic unassignment
- [Due date configuration](https://forum.camunda.io//t/64474) - shows how to set due dates with FEEL expressions, which could be part of your workaround approach

Does this help? If not, can anyone from the **community** jump in? 👋

* * *

💡 _Hints: Use the **Ask AI** feature in [Camunda’s documentation](https://docs.camunda.io/) to chat with AI and get fast help. **Report** bugs and features in [Camuda’s GitHub issue tracker](https://github.com/camunda/camunda/issues/new/choose). Trust the process._ 🤖

---

<div class="post-metadata">

**Author:** ![Tarek\_Mebrouk](https://forum.camunda.io/user_avatar/forum.camunda.io/tarek_mebrouk/32/33386_2.png) [@Tarek\_Mebrouk](https://forum.camunda.io/u/Tarek_Mebrouk)\
**Post date:** [June 30, 2026, 9:13am UTC](https://forum.camunda.io/t/stale-usertask-cleanup/68348/3 "2026-06-30T09:13:22Z")

</div>

Hi [theodor-franke](https://forum.camunda.io/u/theodor-franke),

You are indeed right; this functionality is not natively supported in Camunda 8. However, there are several approaches you can consider to achieve this:

**Option 1: Leverage**  **`dueDate`**  **with a Scheduler** This is similar to what you are currently doing. You can continue to use the `dueDate` field to store the assignment timestamp or the timestamp when the task should be considered stale. Then, implement a scheduled job that periodically queries the Orchestration API, identifies stale tasks based on this `dueDate`, and programmatically unassigns them.

**Option 2: Utilize Timer Boundary Events** You could attach a Timer Boundary Event to the user task. This event would trigger a service task (for example) after a certain duration, which would then unassign the user task. However, as you rightly pointed out, this approach has limitations as it can easily clutter your BPMN processes if you need to replicate this technique across many user tasks.

**Option 3: Use User Task Listeners (Available from Camunda 8.8)** [User Task Listeners](https://docs.camunda.io/docs/components/concepts/user-task-listeners/), available from version 8.8, function similarly to job workers that activate based on an event. You could use an `on assigning` lifecycle event to record the assignment timestamp & userTaskKey (e.g., in an external store). Your scheduled job (e.g., running every few minutes) could then use this data to determine staleness and programmatically call the unassign API endpoint. This approach offers more flexibility and avoids misusing `dueDate` or cluttering your BPMN diagrams with timers for every task.

---

<div class="post-metadata">

**Author:** ![theodor-franke](https://forum.camunda.io/user_avatar/forum.camunda.io/theodor-franke/32/33671_2.png) [@theodor-franke](https://forum.camunda.io/u/theodor-franke)\
**Post date:** [June 30, 2026, 9:30am UTC](https://forum.camunda.io/t/stale-usertask-cleanup/68348/4 "2026-06-30T09:30:41Z")

</div>

Thanks for the answer.

We would really like to avoid using secondary storage for scheduling, as this adds operational complexity and makes backup and restore processes unnecessarily harder.

Does Zeebe really not store the last assignment timestamp internally? I do not necessarily need this field to be filterable through the API. It would already be enough if I could retrieve all currently assigned user tasks and inspect the assignment timestamp in Java.

What would be the best way to create a feature request for this? Should we open a GitHub issue, or would it be better to create a ticket through the Camunda jira portal?

For now, I think we will implement a `lastAssignment` field in the header section of each user task and live with the performance penalty. That said, it is quite frustrating that we have to model and maintain this ourselves.

From my perspective, the assignment timestamp is core task lifecycle metadata, not application-specific business data. It would be much more reasonable if Zeebe tracked this itself and exposed it to users.

---

<div class="post-metadata">

**Author:** ![theodor-franke](https://forum.camunda.io/user_avatar/forum.camunda.io/theodor-franke/32/33671_2.png) [@theodor-franke](https://forum.camunda.io/u/theodor-franke)\
**Post date:** [June 30, 2026, 11:32am UTC](https://forum.camunda.io/t/stale-usertask-cleanup/68348/5 "2026-06-30T11:32:59Z")

</div>

okay now I am confused. the Orchestration-cluster-API does not allow me to update UserTask custom headers? [Update user task | Camunda 8 Docs](https://docs.camunda.io/docs/apis-tools/orchestration-cluster-api-rest/specifications/update-user-task/)

---

<div class="post-metadata">

**Author:** ![Tarek\_Mebrouk](https://forum.camunda.io/user_avatar/forum.camunda.io/tarek_mebrouk/32/33386_2.png) [@Tarek\_Mebrouk](https://forum.camunda.io/u/Tarek_Mebrouk)\
**Post date:** [June 30, 2026, 11:50am UTC](https://forum.camunda.io/t/stale-usertask-cleanup/68348/6 "2026-06-30T11:50:17Z")

</div>

No, Zeebe does not natively store the timestamp of user task assignment. And no, you cannot modify user task custom headers through the Camunda APIs, as these are static metadata that cannot be dynamically changed.

---

<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:** [September 28, 2026, 11:50am UTC](https://forum.camunda.io/t/stale-usertask-cleanup/68348/7 "2026-09-28T11:50:23Z")

</div>

Closed on September 28, 2026, 11:50am UTC

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