Skip to main content
Nintex Community Menu Bar
Question

How to assign a task to the user with the least workload from a dynamic user list?

  • Nov 10, 2026 7:47 AM UTC
  • 0 replies
  • 8 views
  • Translate All

Forum|alt.badge.img

Hi everyone,

I'm working with K2 Five and have the following requirement:

  1. A service returns a dynamic list of candidate users, for example: 
    [
      "AUTO\\UserA",
      "AUTO\\UserB",
      "AUTO\\UserC"
    ]

  2. The candidate list is different for every workflow instance.

  3. Before assigning the task, I need to determine which user currently has the fewest active/open tasks in K2.

  4. The task should then be assigned to that user.

 

I found the SmartObject TaskAllocationRoleMethods and methods such as:

  • Get Least Work
  • Get Most Work
  • Get Round Robin

However, these methods appear to work with a RoleName parameter and not with an ad-hoc list of users returned from a service.

My questions are:

  • Is there a standard K2 approach for finding the user with the least workload from a dynamic user list?
  • Can TaskAllocationRoleMethods.Get Least Work be used without creating a K2 Role?
  • Is it possible to dynamically create/update a role or group at runtime and use it with Get Least Work?
  • Is there an API or SmartObject that can return the number of active worklist items for a specific user?
  • How have others implemented workload-based task assignment when the candidate users are not known in advance?

Any recommendations or best practices would be greatly appreciated.

Thanks!