Automatic Assignment

Automatic Assignment

You also have the option to automatically assign tasks to one of your currently active workers, that is, workers who are idle or in transit in the dashboard (worker state=[1,2]). Note that this is a basic assignment where the newly-created task is appended to the end of the optimal worker's container.

The autoAssign object property available at task creation has the following structure:

NameTypeDescription
modestringThe desired automatic assignment mode. Either distance or load.
teamstringOptional. The ID of a team from which to pick the workers to consider for automatic assignment. Required to have Dashboard setting in order for this field to consider the Teams specified in the API request payload. See example at the bottom of this page.
maxAssignedTaskCountnumberOptional. The maximum number of tasks a worker can have assigned after the automatic assignment is made.
considerDependenciesbooleanOptional. Whether to include the target task's dependency family (parent and child tasks) in the resulting assignment operation.
excludedWorkerIdsstring arrayOptional. One or more IDs of workers that should not be considered in assignment calculations.

In both modes, we calculate the geodesic distance using Vincenty's formula for ellipsoids between destination coordinates, with one meter precision.

The distance mode finds the active worker whose last-known location is closest to the task's destination.

The load mode walks the distance from the active worker's last-known location to their active task, if there is one, and through to each of the ordered destinations corresponding to the worker's assigned tasks, with the final computation being from their last-assigned task to the newly-created one. The worker who has to travel the shortest distance is considered to have the lightest load, and as such will be assigned the task being created.

If an automatic assignment is requested and successful, didAutoAssign will be set to true and the task's container details will indicate which worker the task was appended to. If we fail to find a suitable worker because of an error or any other unexpected condition, didAutoAssign will be false.

Note: maxAssignedTaskCount does not consider tasks that have been started - only assigned tasks are counted.

📘

Restrict auto-assign to Teams

Must have this setting checked on the dashboard in order for the Team field to be considered. Otherwise all available drivers will be considered.

571

Restrict auto-assign to Teams