Hi,
This is expected behavior in Mendix Workflows and is caused by a race condition, not a configuration bug.
What’s really happening
When a task is visible to multiple users:
“Only assigned user can complete the task”
“Task no longer exists”
This is by design in Mendix.
Why manually changing assignees does NOT work
Changing the UserTask → Assignee association via a custom microflow does not update the workflow engine state.
So even if:
The engine still detects an invalid runtime state and throws errors.
This approach is unsupported and should be avoided.
Correct and supported pattern (recommended by Mendix)
For first-come, first-serve approval:
This makes the action atomic, eliminating race conditions.
UI best practice
“This task was already completed by another user.”
Key takeaway
Problem:
This is a race condition. Multiple users can open the same task. When one user completes it, the task becomes invalid for others, causing errors like “Only assigned user can complete the task” or “Task no longer exists”. This is expected behavior.
Solution:
For a first-come, first-serve setup, make the task visible to both roles, but assign and complete it in one single action. Call AssignTaskToCurrentUser and immediately CompleteUserTask in the same microflow. Avoid a separate “Assign to me” step.
Result:
The first user completes the task, and other users won’t hit runtime errors if they open it later.
What if I have different users that have the same UserRole? Would any user be able to complete the task without getting the error “Only assigned user can complete the task” or “Task no longer exists”?
This is my use case, I have a user creating the task, he does 2 or three tasks, and it chooses a time to run the third tasks for a time of 8-200 hours typically. Then the next user with the same UserRole comes hours later to continue with the following task in the workflow.
This how I am assigning the User that should be able to complete the tasks.
[( System.UserRoles = '[%UserRole_Operator%]' )]