Skip To Content ArcGIS for Developers Sign In Dashboard

ArcGIS API for Python

Managing ArcGIS Workforce projects

ArcGIS Workforce is a mobile solution that uses the power of location-based decision making for better field workforce coordination and teamwork. It is composed of a web app used by project administrators and dispatchers in the office, and a mobile app used by mobile workers on their devices. Organizations using ArcGIS Workforce get these benefits:

  • Everything you need on one device. Mobile workers can easily view and process work assignments, provide updates on work status, and inform others of their location, all from one device.

  • Greater agility—Using real-time and location-based information, dispatchers can assign and prioritize fieldwork on the fly and ensure that work is assigned to the right people at the right time.

  • Increased productivity—Replace time-consuming and error-prone manual workforce management processes, reduce downtime, and keep projects on schedule.

Contents of a Workforce project

A workforce project is composed of four point feature layers:

  • Workers - contains a record for each mobile worker along with their contact number and job title.
  • Assignments - contains a record for each assignment. It stores information such as status, location, and description, among others.
  • Dispatchers - contains a record for each dispatcher within the project and includes information such as name and contact number.
  • Location Tracking - contains a record for each point location logged while location tracking is enabled.

and two web maps:

  • Dispatcher web map - for back-office dispatchers. It shows the assignments and worker locations
  • Worker web map - This map is what a field worker uses on their iOS or Android device.

and a workforce project item. This is an item on the portal that stores project meta data in json format. This item connects all the layers and maps described above.

The feature layers described above are named using a combination of a moniker, describing the purpose of the feature layer, appended with the GUID of the Workforce project item. For example, the Workers layer associated with a project with GUID 5dd018fcd88c4d33814cf3da9c44061e would be named workers_5dd018fcd88c4d33814cf3da9c44061e. This guarantees uniqueness of each feature layer. The four feature layers are connected to one-another using primary key-foreign key relationships to track the workforce. To know more about those details, refer here.

What can you do with this module?

Using the workforce module under the arcgis.apps module, you can automate the following tasks:

Workers and Dispatchers

  • Adding Dispatchers and Workers to a Project
  • Deleting Dispatchers and Workers from a Project
  • Updating Workers and Dispatchers in a Project
  • Searching Workers and Dispatchers in a Project


  • Adding Assignments to a Project
  • Deleting Assignments from a Project
  • Updating Assignments in a Project
  • Assigning Assignments in a Project
  • Searching Assignments in a Project
  • Adding/Removing/Downloading Attachments


  • Searching Tracks (for analysis)

Get Started

A user must be authenticated with a GIS in order to fetch a Project. The workforce functionality is available in arcgis.apps.workforce module.

In [1]:
from arcgis.gis import GIS
from arcgis.apps import workforce

gis = GIS('', 'arcgis_python')
Enter password: ········

Workforce Project

A project is created using its corresponding item.

In [6]:
workforce_project_item = gis.content.get("c63e3d46af7d4204b66b18d43a188c2e")
This is a demo workforce projectWorkforce Project by arcgis_python
Last Modified: April 10, 2018
0 comments, 1 views
In [23]:
project = workforce.Project(item=workforce_project_item)
<Project c63e3d46af7d4204b66b18d43a188c2e>


Assignment objects are accessed by using the assignments property off the Project object. Assignments can be added, updated, or deleted. Additionally, attachments can be added, deleted, or downloaded by using the attachments property off the Assignment object.

In [11]:
# Search all assignments
assignments =
[<Assignment 1>, <Assignment 2>]
In [3]:
# View first assignment
assignment = assignments[0]
print(f"Status: {assignment.status}")
print(f"Description: {assignment.description}")
print(f"Priority: {assignment.priority}")
print(f"Assigned To: {}")
print(f"Type: {assignment.assignment_type}")

# Update the description of the assignment
assignment.update(description="You need to do an inspection here")
print(f"Updated Description: {[0].description}")

# Download the assignment using the AssignmentAttachmentManager
Status: assigned
Description: Do some work at the ESRI R&D Center
Priority: medium
Assigned To: Aaron Pulver
Type: Inspection
Updated Description: You need to do an inspection here

Assignment Types

Assignment types are created when the workforce project is originally created. All assignments fall under one or the other assignment types. You can access these types by calling the assignment_types property off the Project item. Assignment types can be added, updated, or deleted.

In [4]:
# List all assignment types
assignment_types =
for at in assignment_types:
    print(f"Type: {}")
# Add a new assignment type

# Confirm that it was added
assignment_types =
for at in assignment_types:
    print(f"Type: {}")
Type: Inspection
Type: Removal
Type: Inspection
Type: Removal
Type: Repair


Worker objects are accessed by using workers property off the Project object. Workers can be added, updated, or deleted.

In [5]:
# Search all workers and print details about first worker 
workers =
worker = workers[0]
print(f"Name: {}")
print(f"Number: {worker.contact_number}")
# Update the workers contact number
print(f"Number: {[0].contact_number}")
Name: Aaron Pulver
Number: None
Number: 123-456-7890

Note: Workers and Dispatchers should be named users in your GIS.

In [6]:
# Add a new worker
project.workers.add(name="Demo User", 
<Worker 34>


Dispatcher objects are accessed by using dispatchers property off the Project object. Dispatchers can be added, updated, or deleted.

In [7]:
# Search for all dispatchers and print details about first dispatcher
dispatchers =
dispatcher = dispatchers[0]
print(f"Name: {}")
print(f"Number: {dispatcher.contact_number}")
# Update the dispatchers contact number
print(f"Number: {[0].contact_number}")
Name: workforce scripts
Number: 987-654-3210
Number: 123-456-7890

Web maps

The dispatcher and worker WebMap objects can be accessed using the corresponding properties as shown in the following code snippet. Using the WebMap object, additional layers could be added or removed from either maps.

In [15]:
# Worker webmap
worker_webmap = project.worker_webmap
In [17]:

In [25]:
# Dispatcher webmap
dispatcher_webmap = project.dispatcher_webmap

Putting it all together

In the following snippet, a new assignment will be created at the ESRI campus. Assignments (as well as workers, assignment types, dispatchers, and tracks) are all validated prior to upload. The ensures the integrity of the workforce project.

In [10]:
# Add a new assignment and assign it to demouser
from datetime import datetime
demouser = project.workers.get(user_id='demouser_nitro')
dispatcher = project.dispatchers.get(user_id='workforce_scripts')
repair = project.assignment_types.get(name="Repair")

# Use the geocoder to find the location of ESRI
from arcgis.geocoding import geocode
geometry = geocode("ESRI, Redlands, CA", out_sr=102100)[0]['location']

# Add a new assignment
                       location="ESRI, Redlands, CA",
<Assignment 66>

Reset the Demo Project

The following code resets the project to the intial state for this demo. It also highlights how batch methods can be used to add/update/delete many workforce items at once. This is useful when processing large amounts of assignments, workers, or dispatchers. In general, batch methods make fewer calls to the backend server thus reducing the overall time of the script.

In [11]:
# Use batch functions to process multiple items at a time

# Reset the assignment description
a = project.assignments.get(object_id=1)
a.update(description="Do some work at the ESRI R&D Center")

# Reset the worker using batch update
w1 = project.workers.get(object_id=1)
w1.contact_number = None

# Reset the dispatcher using batch update
d1 = project.dispatchers.get(object_id=1)
d1.contact_number = "987-654-3210"
[<Dispatcher 1>]

Feedback on this topic?