The arcgis.workflowmanager module contains classes and functions for working with a Workflow Manager installation. Workflow diagrams, job templates and jobs can be created, modified, or deleted. Information such as location, assignment, history and attachments for individual jobs can be accessed. Additionally, information about the various roles, users, groups, and searches can be view, modified or created.
WorkflowManager
- class arcgis.gis.workflowmanager.WorkflowManager(item)
- Bases: - object- Represents a connection to a Workflow Manager instance or item. - Users create, update, delete workflow diagrams, job templates and jobs or the various other properties with a workflow item. - Parameter - Description - item - Required string. The Workflow Manager Item - # USAGE EXAMPLE: Creating a WorkflowManager object from a workflow item from arcgis.gis.workflowmanager import WorkflowManager from arcgis.gis import GIS # connect to your GIS and get the web map item gis = GIS(url, username, password) wf_item = gis.content.get('1234abcd_workflow item id') # create a WorkflowManager object from the workflow item wm = WorkflowManager(wf_item) type(wm) >> arcgis.gis.workflowmanager.WorkflowManager # explore the users in this workflow using the 'users' property wm.users >> [{}...{}] # returns a list of dictionaries representing each user - property assignable_groups
- Get portal groups associated with Workflow Manager roles, to which the current user can assign work based on their Workflow Manager assignment privileges. 
 - property assignable_users
- Get all assignable users for a user in the workflow system - Returns:
- A list of the assignable - userobjects
 
 - create_diagram(name: str, steps: list, display_grid: bool, description: str = '', active: bool = False, annotations: list = [], data_sources: list = [], diagram_id: str | None = None, centralized_data_references: list = [], use_centralized_data_references: bool = False)
- Adds a diagram to the Workflow Manager instance given a user-defined name and array of steps - Parameter - Description - name - Required string. Diagram Name - steps - Required list. List of Step objects associated with the Diagram - display_grid - Required boolean. Boolean indicating whether the grid will be displayed in the Diagram - description - Optional string. Diagram description - active - Optional Boolean. Indicates whether the Diagram is active - annotations - Optional list. List of Annotation objects associated with the Diagram - data_sources - Optional list. Spatial data that will be used in the steps of the diagram. Note: It is recommended to use centralizedDataReferences for new diagrams. Data sources are not supported in ArcGIS Online. - diagram_id - Optional string. The unique ID of the diagram to be created. - centralized_data_references - Optional list. The Centralized references to data and other content that will be used in the steps of the diagram. See details for CentralizedDataReference below - use_centralized_data_references - Optional boolean. Indicates that the diagram’s step configurations make use of CentralizedDataReferences. Defaults to false. Note: It is recommended that this is set to True for new diagrams - Returns:
 - CentralizedDataReference Dictionary- Parameter - Description - id - Required string. The unique identifier of the data reference to be stored in the diagram. - alias - Required string. The unique name of the data reference to be stored in the diagram. - isValidated - Required boolean. Indicates whether the data reference has been validated. Note: Pro Items and Pro Commands are not validated. - referenceType - Required string. The type of data reference. Accepted values include FeatureService, Survey, GeoprocessingService, WebMap, ProProject, ProMapItem, ProSceneItem, ProTaskItem, ProLayoutItem, ProSystemToolboxItem, or ProCommand. Note: Geoprocessing services must use either standaloneGPUrl or portalItem. - capabilities - Optional list. The capabilities of a branch versioned feature service. Valid values include SupportsBranchVersioning, SupportsCreateReplica, and SupportsDataQuality. - portalItem - Optional portalItem dict. The item information for the reference. Required for referencesTypes set to FeatureService, Survey, WebMap, or ProProject. For more details, see PortalItem below. - proItemName - Optional string. The name of the Pro item. Required when the referenceType is set to ProMapItem, ProSceneItem, ProTaskItem, ProLayoutItem, or ProSystemToolboxItem - command - Optional string. The Pro command DAML id. Required when the referenceType is ProCommand. - standaloneGPUrl - Optional string. The service URL for the Geoprocessing Service. Required when the referenceType is GeoprocessingService and portalItem is not defined. - # CentralizedDataReference Object Example 1: { "id": "50c6a626-2e45-4cfa-b149-3add455f9d72", "alias": "ParcelFabricDataQuality", "portalItem": { "itemId": "a64fdcf5e7b44a27bd98d098ca02ca57", "portalType": "Current", "portalUrl": null }, "isValidated": true, "referenceType": "FeatureService", "capabilities": [ "SupportsBranchVersioning", "SupportsDataQuality" ] } - # CentralizedDataReference Object Example 2: { "id": "f9f002b0-ea3e-49a3-b40c-5e08687282f0", "alias": "GeocodingTools", "portalItem": { "itemId": "7eacbbfff9a24bc0a7fc0e9d7b805ccd", "portalType": "Current", "portalUrl": null }, "isValidated": true, "referenceType": "GeoprocessingService" } - # CentralizedDataReference Object Example 3: { "id": "b09ae444-3400-49ca-9a1b-1f3795332139", "alias": "Echo Tool", "isValidated": true, "referenceType": "GeoprocessingService", "standaloneGPUrl": "https://example.esri.com/arcgis/rest/services/ProcessingTool/GPServer/ProcessingTool" } - # CentralizedDataReference Object Example 4: { "id": "e8e5c963-a485-4f5f-a298-dcf430f72c28", "proItemName": "MyProMap", "referenceType": "ProMapItem" } - PortalItem Object- Parameter - Description - itemId - Required string. The unique item identifier of the Portal item. - portalType - Optional string. The hosting Portal location of the data reference relative to the workflow item. Accepted values include Current, ArcGIS Online, and Other. This value is set to Current by default. - portalUrl - Optional string. Required when portalType is set to Other, the full URL including Web Adaptor for the Portal hosting the item. 
 - create_job_template(name: str, priority: str, id: str = None, category: str = '', job_duration: int = 0, assigned_to: str = '', default_due_date: str | None = None, default_start_date: str | None = None, start_date_type: str = 'CreationDate', diagram_id: str = '', diagram_name: str = '', assigned_type: str = 'Unassigned', description: str = '', default_description: str = '', state: str = 'Draft', last_updated_by: str = '', last_updated_date: str | None = None, extended_property_table_definitions: list = [])
- Adds a job template to the Workflow Manager instance given a user-defined name and default priority level - Parameter - Description - name - Required string. Job Template Name - priority - Required string. Default Job Template Priority Level - id - Optional string. Job Template ID - category - Optional string. Job Template Category - job_duration - Optional int. Default Job Template Duration - assigned_to - Optional string. Job Owner - default_due_date - Optional string. Due Date for Job Template - default_start_date - Optional string. Start Date for Job Template - start_date_type - Optional string. Type of Start Date (e.g. creationDate) - diagram_id - Optional string. Job Template Diagram ID - diagram_name - Optional string. Job Template Diagram Name - assigned_type - Optional string. Type of Job Template Assignment - description - Optional string. Job Template Description - default_description - Optional string. Default Job Template Description - state - Optional string. Default Job Template State - last_updated_by - Optional string. User Who Last Updated Job Template - last_updated_date - Optional string. Date of Last Job Template Update - extended_property_table_definitions - Optional list. List of Extended Properties for Job Template - Returns:
- Workflow Manager - JobTemplateID
 
 - create_lookup(lookup_type, lookups)
- Adds a diagram to the Workflow Manager instance given a user-defined name and array of steps - Parameter - Description - lookup_type - Required string. The type of lookup table stored in the workflow item. - lookups - Required list. List of lookups to be created / updated - Returns:
- Boolean 
 - # USAGE EXAMPLE: Creating a Lookup Table # create a WorkflowManager object from the workflow item wm = WorkflowManager(wf_item) # create the lookups object lookups = [{"lookupName": "Low", "value": 0}, {"lookupName": "Medium", "value": 5}, {"lookupName": "High", "value": 10}, {"lookupName": "EXTRA", "value": 15}, {"lookupName": "TEST", "value": 110}] wm.create_lookup("priority", lookups) >> True # returns true if created successfully 
 - create_template(template_type: str, template_name: str, template_details: dict, template_id: str | None = None)
- Returns the newly created template id. - Parameter - Description - template_type - Required string. The type of template stored in the workflow item. Create an email template by entering ‘email’, a Web Request Template by entering ‘webRequest’, or enter your own value to define a custom template. - template_name - Required string. The new name to be given to the template - template_details - Required dict. The new information to be stored in the template - template_id - Optional string. The id of the template to be created - Returns:
- Workflow Manager - TemplateID
 - # USAGE EXAMPLE: Creating a Template # create a WorkflowManager object from the workflow item wm = WorkflowManager(wf_item) # create the template object details = { "to":["user@esri.com"], "cc":["boss@esri.com"], "bcc":["supervisor@esri.com"], "subject":"Workflow Manager Templates", "body":"Look how easy it is to make an email template!", "attachmentSelection":"None" } wm.create_template(template_type="email", template_name="Email Template", template_details=details) >> Ef42tu_QQMS-IgZc7pOPnQ # returns Template ID if created successfully 
 - create_wm_role(name, description='', privileges=[])
- Adds a role to the Workflow Manager instance given a user-defined name - Parameter - Description - name - Required string. Role Name (required) - description - Required string. Role Description - privileges - Required list. List of privileges associated with the role - Returns:
- Workflow Manager - WMRoleObject
 
 - delete_diagram(id: str)
- Deletes a diagram object by ID - Parameter - Description - id - Required string. Diagram id - Returns:
 
 - delete_diagram_version(diagram_id, version_id)
- Deletes a diagram version by ID - Parameter - Description - diagram_id - Required string. Diagram ID - version_id - Required string. Diagram Version ID - Returns:
- Boolean 
 
 - delete_job_template(id: str)
- Deletes a job template with the given ID - Parameter - Description - id - Required string. Job Template ID - Returns:
- status code 
 
 - delete_lookup(lookup_type)
- Deletes a job template with the given ID - Parameter - Description - lookup_type - Required string. The type of lookup table stored in the workflow item. - Returns:
- status code 
 
 - delete_template(template_type: str, template_id: str)
- Returns a boolean indicating whether or not the template has been deleted. - Parameter - Description - template_type - Required string. The type of template stored in the workflow item. Delete an email template by entering ‘email’, a Web Request Template by entering ‘webRequest’, or enter your own value to delete a custom template. - template_id - Required string. The id of the template to be deleted - Returns:
- Boolean 
 
 - delete_wm_role(name: str)
- Returns boolean indicating whether or not the role was deleted. - Parameter - Description - name - Required string. Role Name - Returns:
- Boolean 
 
 - diagram(id: str)
- Returns the - diagramwith the given ID- Parameter - Description - id - Required string. Diagram ID - Returns:
- Workflow Manager - JobDiagramObject
 
 - diagram_upgraded_version(diagram_id: str, version_id: str)
- Get an upgraded version of a workflow diagram that uses centralized data references. If the version number does not exist, an error saying the specific diagram version does not exist is returned. The adminBasic or adminAdvanced privilege is required to get an upgraded diagram. - Note: You can upgrade a diagram by placing the transformedDiagram dictionary in the diagram parameter of update_diagram. - Parameter - Description - diagram_id - Required string. Diagram ID - version_id - Required string. Diagram Version ID - Returns:
- Success Object 
 - # USAGE EXAMPLE: Using the transformedDiagram from the result object to update a diagram. # create a WorkflowManager object from the workflow item wm = WorkflowManager(wf_item) upgrade_obj = wm.diagram_upgraded_version("gb1GBilqT4yk68Hfs5ghxw", diagram_version=1) # update diagram draft wm.update_diagram( body=upgrade_obj['transformedDiagram'] ) - # Success Object Example: { "transformedDiagram": { "diagramId": "gb1GBilqT4yk68Hfs5ghxw", "diagramVersion": 1, "diagramName": "Test New Diagram123 2024_12_13_11_59_54_764959", "description": "Test Description", "initialStepId": "1640baf9-f934-fd12-2b62-af6bfc2d0e87", "initialStepName": "Start/End", "steps": [ { "id": "1640baf9-f934-fd12-2b62-af6bfc2d0e87", "name": "Start/End", "description": "Start and end of a workflow", "stepTemplateId": "AVw8d6MdyiKjHtuS9dJ6", "automatic": false, "proceedNext": true, "canSkip": false, "position": "0,0,100,50", "shape": 3, "color": "130, 202, 237", "outlineColor": "130, 202, 237", "labelColor": "black", "action": { "actionType": "Manual" }, "paths": [ { "nextStep": "21bff5ee-1586-a635-30ea-86769f01ac93", "points": [ { "x": 0, "y": 26 }, { "x": 0, "y": 74 } ], "ports": [ "BOTTOM", "TOP" ], "assignedType": "Unassigned", "notifications": [], "lineColor": "black" } ], "helpUrl": "Start/End help url", "helpText": "Start/End help text" } ], "centralizedDataReferences": [], "displayGrid": true, "useCentralizedDataReferences": true }, "modifiedStepIds": [], "failedStepIds": [], "modifiedDataSourceNames": [], "failedDataSourceNames": [] } 
 - diagram_version(diagram_id: str, version_id: str)
- Returns the - diagramwith the given version ID- Parameter - Description - diagram_id - Required string. Diagram ID - version_id - Required string. Diagram Version ID - Returns:
- Specified version of the Workflow Manager - JobDiagramobject
 
 - evaluate_arcade(expression: str, context: str | None = None, context_type: str = 'BaseContext', mode: str = 'Standard')
- Evaluates an arcade expression - Parameter - Description - expression - Required String. - context - Optional String. - context_type - Optional String. - mode - Optional String. - Returns:
- String 
 
 - get_template(template_type: str, template_id: str)
- Returns a Template by the given type and id - Parameter - Description - template_type - Required string. The type of template stored in the workflow item. Get an email template by entering ‘email’, a Web Request Template by entering ‘webRequest’, or enter your own value to get a custom template. - template_id - Required string. The id of the template to be retrieved - Returns:
- Workflow Manager - TemplateObject
 - # USAGE EXAMPLE: Get a Template # create a WorkflowManager object from the workflow item wm = WorkflowManager(wf_item) # get a template wm.get_template(template_type="email", template_id="Ef42tu_QQMS-IgZc7pOPnQ") >> { "template_name": "Email Template", "template_id": "Ef42tu_QQMS-IgZc7pOPnQ", "template_details": {"to":["user@esri.com"], "cc":["boss@esri.com"], "bcc":["supervisor@esri.com"], "subject":"Workflow Manager Templates", "body":"Look how easy it is to make an email template!", "attachmentSelection":"None", "attachmentFolder":null } } 
 - group(group_id: str)
- Returns group information with the given group ID - Parameter - Description - group_id - Required string. Workflow Manager Group ID - Returns:
- Workflow Manager - GroupObject
 
 - job_template(id: str)
- Returns a job template with the given ID - Parameter - Description - id - Required string. Job Template ID - Returns:
- Workflow Manager - JobTemplateObject
 
 - property job_templates
- Gets all the job templates in a workflow item. - Returns:
- List of all current - job templatesin the Workflow Manager (required information for create_job call).
 
 - property jobs
- The job manager for a workflow item. - Returns:
- JobManagerobject
 
 - lookups(lookup_type)
- Returns LookUp Tables by given type - Parameter - Description - lookup_type - Required string. The type of lookup table stored in the workflow item. - Returns:
- Workflow Manager - LookUpTableObject
 
 - searches(search_type: str | None = None)
- Returns a list of all saved searches. - Parameter - Description - search_type - Optional string. The search type for returned saved searches. The accepted values are Standard, Chart, and All. If not defined, the Standard searches are returned. - Returns:
 
 - property table_definitions
- Get the definitions of each extended properties table in a workflow item. The response will consist of a list of table definitions. If the extended properties table is a feature service, its definition will include a dictionary of feature service properties. Each table definition will also include definitions of the properties it contains and list the associated job templates. This requires the adminBasic or adminAdvanced privileges. - Returns:
 
 - templates(template_type)
- Returns Templates by given type - Parameter - Description - template_type - Required string. The type of template stored in the workflow item. Get the email templates by entering ‘email’, the Web Request Templates by entering ‘webRequest’, or, enter your own value to get the custom templates. - Returns:
- Workflow Manager - TemplateList
 
 - update_diagram(body, delete_draft: bool = True)
- Updates a diagram object by ID - Parameter - Description - body - Required object. Diagram body - existing Diagram object that inherits required/optional fields. - delete_draft - Optional Boolean - option to delete the Diagram draft (optional) - Returns:
- success object 
 - # USAGE EXAMPLE: Updating a diagram with centralized data references # create a WorkflowManager object from the workflow item wm = WorkflowManager(wf_item) # The update body contains only those fields we wish to update. updated_diagram_body = { "diagramName": "Updated Diagram Name", "description": "Updated", "centralizedDataReferences": [ { "id": "f9f002b0-ea3e-49a3-b40c-5e08687282f0", "alias": "GeocodingTools", "isValidated": true, "portalItem": { "itemId": "7eacbbfff9a24bc0a7fc0e9d7b805ccd", "portalType": "Current" }, "acceptsToken": true, "referenceType": "GeoprocessingService" }, { "id": "5a3aa2d1-06ed-49fc-9c38-e1576d9cc5d2", "alias": "Example Feature Service", "portalItem": { "itemId": "a64fdcf5e7b44a27bd98d098ca02ca57", "portalType": "Current", "portalUrl": null }, "isValidated": true, "referenceType": "FeatureService", "capabilities": [ "SupportsBranchVersioning", "SupportsDataQuality" ] } ] "useCentralizedDataReferences": True } wm.update_diagram(update_diagram_body, delete_draft=True) 
 - update_group(group_id: str, update_object)
- Update the information to the portal group. The adminAdvanced privilege is required. New roles can be added to the portal group. Existing roles can be deleted from the portal group. - Parameter - Description - group_id - Required string. - Workflow Manager GroupID- update_object - Required object. Object containing the updated actions of the information to be taken to the portal group. - Returns:
- Boolean 
 
 - update_job_template(template)
- Updates a job template object by ID - Parameter - Description - template - Required object. - Job Templatebody. Existing Job Template object that inherits required/optional fields.- Returns:
- success object 
 
 - update_settings(props: list)
- Returns an active job with the given ID - Parameter - Description - props - Required list. A list of Props objects to update (Prop object example: {‘propName’: ‘string’, ‘value’: ‘string’}) - Returns:
- success object 
 
 - update_template(template_type: str, template_id: str, template_name: str, template_details: str)
- Returns a boolean indicating whether or not the template was updated. - Parameter - Description - template_type - Required string. The type of template stored in the workflow item. Update an email template by entering ‘email’, a Web Request Template by entering ‘webRequest’, or enter your own value to update a custom template. - template_id - Required string. The id of the template to be updated - template_name - Required string. The new name to be given to the template - template_details - Required dict. The new information to be stored in the template - Returns:
- Boolean 
 - # USAGE EXAMPLE: Update a Template # update a WorkflowManager object from the workflow item wm = WorkflowManager(wf_item) # update the template object details = { "to":["user@esri.com"], "cc":["boss@esri.com"], "bcc":["supervisor@esri.com"], "subject": "Workflow Manager Templates", "body": "Look how easy it is to make an email template!", "attachmentSelection":"None" } wm.update_template(template_type="email", template_id='Ef42tu_QQMS-IgZc7pOPnQ' template_name="Email Template", template_details=details) >> True # returns True if updated successfully 
 - user(username: str)
- Returns a user profile with the given username - Parameter - Description - username - Required string. Workflow Manager Username - Returns:
- Workflow Manager user profile 
 
 - property user_settings
- Returns a list of all the user-defined settings for the Workflow Manager instance - Returns:
 
 - property users
- Returns an list of all user profiles stored in Workflow Manager - Returns:
- List of - userprofiles
 
 - wm_role(name: str)
- Returns an active role with the given name - Parameter - Description - name - Required string. Role Name - Returns:
- Workflow Manager - RoleObject
 
 - property wm_roles
- Returns a list of user - rolesavailable in the local Workflow Manager instance.- Returns:
- List 
 
 
WorkflowManagerAdmin
- class arcgis.gis.workflowmanager.WorkflowManagerAdmin(gis)
- Bases: - object- Represents a series of CRUD functions for Workflow Manager Items - Parameter - Description - gis - Optional GIS. The connection to the Enterprise. - create_item(name: str) tuple
- Creates a Workflow Manager schema that stores all the configuration information and location data in the data store on Portal. This can be run by any user assigned to the administrator role in Portal. - For users that do not belong to the administrator role, the following privileges are required to run Create Workflow Item: - Parameter - Description - name - Required String. The name of the new schema. - Returns:
- string (item_id) 
 
 - delete_item(item)
- Delete a Workflow Manager schema. Does not delete the Workflow Manager Admin group. Requires the administrator or publisher role. If the user has the publisher role, the user must also be the owner of the item to delete. - Parameter - Description - id - Required Item. The Workflow Manager Item to be deleted - Returns:
- success object 
 
 - export_item(item, job_template_ids: list[str] | None = None, diagram_ids: list[str] | None = None, include_other_configs: bool = True, passphrase: str | None = None, run_async: bool = False, save_path: str | None = None, export_mapping: bool | None = None) str | ItemExecution
- Exports a new Workflow Manager configuration (.wmc) file based on the indicated item. This configuration file includes the version, job templates, diagrams, roles, role-group associations, lookup tables, charts and queries, templates, and user settings of the indicated item. This file can be used with the import endpoint to update other item configurations. Configurations from Workflow items with a server that is on a more recent version will not import due to incompatibility. - Argument - Description - item - Required Item. The Workflow Manager Item to be exported - job_template_ids - Optional. The job template(s) to be exported. If job template is exported, the associated diagram must be included to be exported. - diagram_ids - Optional. The diagram(s) to be exported. If not defined, all diagrams are exported. If defined as empty, no diagram is exported - include_other_configs - Optional. If false other configurations are not exported including templates, User defined settings, shared searches, shared queries, email settings etc. - passphrase - Optional. If exporting encrypted user defined settings, define a passphrase. If no passphrase is specified, the keys for encrypted user defined settings will be exported without their values. Starting at 12.0, this property is deprecated. - run_async - Optional. A boolean indicating whether to run export item asynchronously. If set to true, export_item will return a - ItemExecution. The download location can then be found by prompting for the export_location.- save_path - Optional. The directory location to save the wmc file and optional mapping file after export finishes. If not set, the file(s) will download to the default location. - export_mapping - Optional. Export a mapping file along with the item configuration. If not defined, no mapping file will be generated. This option will only apply if run_async is True. - return:
- String if run_async is False or - ItemExecutionif run_async is True
 - # USAGE EXAMPLE: Export An Item Asynchronously # create a Workflow Manager object from the workflow item workflow_manager_admin = WorkflowManagerAdmin(gis) item = gis.content.search('title:"Python Sample"')[0] export_execution = workflow_manager_admin.export_item(item, run_async=True, save_path='/path/to/item', export_mapping=True) # result() blocks execution until the asynchronous work is finished and returns the last message received. result = export_execution.result() print(f'Result = {result} - ‘) - # Use .done() in a loop if you want to perform other actions while waiting for export to complete # while not export_execution.done(): # print(f’Progress = {export_execution.status}’) # print(f’{export_execution.messages}’) # time.sleep(5) - print(f’Here is the Exported ID: {export_execution.export_id}’) print(f’Here is the Exported File Location: {export_execution.export_location} - ‘)
- print(f’Here is the Exported Mapping File Location: {export_execution.export_mapping_location} 
 - ‘) 
 - property health_check
- Checks the health of Workflow Manager Server and if the cluster is active (if applicable). - Returns:
- Boolean 
 
 - import_item(item, config_file, passphrase: str | None = None, run_async: bool = False, overwrite_configuration: bool = True, import_mapping_file: str | None = None) bool | ItemExecution
- Imports a new Workflow Manager configuration from the selected .wmc file. Configurations from Workflow items with a server that is on a more recent version will not import due to incompatibility. This will completely replace the version, job templates, diagrams, roles, role-group associations, lookup tables, charts and queries, templates, and user settings of the indicated item, and it is recommended to back up configurations before importing. Any encrypted settings included will only have their key imported and will need the value updated. Importing will fail if any jobs exist in the destination item. Excess scheduled tasks will be dropped based on the portal limit. - Argument - Description - item - Required Item. The Workflow Manager Item that to import the configuration to. - config_file - Required. The file path to the Workflow Manager configuration file. - passphrase - Optional. If importing encrypted user defined settings, specify the same passphrase used when exporting the configuration file. If no passphrase is specified, the keys for encrypted user defined settings will be imported without their values. Starting at 12.0, this property is deprecated. - run_async - Optional. A boolean indicating whether to run import item asynchronously. If set to true, import_item will return a - ItemExecution- overwrite_configuration - Optional. A boolean indicating whether to overwrite the current item’s contents. When set to true, the current item must not have existing jobs, and its contents will be deleted and replaced by the contents of the imported configuration file. When set to False, importing merges the source configuration with the current item. By default this setting is true. - import_mapping_file - Optional. Should only be used when run_async is True. The file path to the Workflow Manager mapping file to be used during the import process. - return:
- bool if run_async is False or - ItemExecutionif run_async is True
 - # USAGE EXAMPLE: Import An Item Asynchronously # Create a new item using workflow_manager_admin new_item_id = workflow_manager_admin.create_item(name='New Workflow Item') new_item = gis.content.get(new_item_id) # Path to location of .wmc file from a previous exported item. filepath = 'C:\Users\exampleUser\Desktop\test.wmc' mappingfilepath = 'C:\Users\exampleUser\Desktop\testmappingfile.json' import_execution = workflow_manager_admin.import_item(new_item, filepath, run_async=True, overwrite_configuration=False, import_mapping_file=mappingfilepath) # result() blocks execution until the asynchronous work is finished and returns the last message received. result = export_execution.result() print(f'Result = {result} - ‘) - # Use .done() in a loop if you want to perform other actions while waiting for import to complete # while not import_execution.done(): # print(f’Progress = {import_execution.status}’) # print(f’{import_execution.messages}’) # time.sleep(5) - print(f’Status = {import_execution.status}’) print(f’Time elapsed {import_execution.elapse_time}’) print(f’Messages received: ‘) for m in import_execution.messages: - print(f’{m.message} ‘) 
 
JobManager
- class arcgis.gis.workflowmanager.JobManager(item, workflow_manager)
- Bases: - object- Represents a helper class for Workflow Manager jobs. Accessible as the - jobsproperty of the- WorkflowManager.- close(job_ids: list)
- Closes a single or multiple jobs with specific Job IDs - Parameter - Description - job_ids - Required list of job ID strings - Returns:
- success object 
 
 - create(template: str, count: int = 1, name: str | None = None, start: str | None = None, end: str | None = None, priority: str | None = None, description: str | None = None, owner: str | None = None, group: str | None = None, assigned: str | None = None, complete: str | None = None, notes: str | None = None, parent: str | None = None, location: Optional = None, extended_properties: dict | None = None, related_properties: dict | None = None, job_id: str | None = None)
- Adds a job to the Workflow Manager instance given a user-defined template - Parameter - Description - template - Required object. Workflow Manager Job Template ID - count - Optional Integer Number of jobs to create - name - Optional string. Job Name - start - Optional string. Job Start Date - end - Optional string. Job End Date - priority - Optional string. Job Priority Level - description - Optional string. Job Description - owner - Optional string. Job Owner - group - Optional string. Job Assignment Group. The Assignment type of the job to be created. Type of assignment designated Values: “User” | “Group” | “Unassigned” - assigned - Optional string. Initial Job Assignee - complete - Optional Integer Percentage Complete - notes - Optional string. Job Notes - parent - Optional string Parent Job - location - Optional Geometry or Workflow Manager - JobLocationDefine an area of location for your job.- extended_properties - Optional Dict. Define additional properties on a job template specific to your business needs. - related_properties - Optional Dict. Define additional 1-M properties on a job template specific to your business needs. - job_id - Optional string. Define the unique jobId of the job to be created. Once defined, only one job can be created. - Returns:
- List of newly created job ids 
 
 - delete(job_ids: list)
- Deletes a single or multiple jobs with specific JobIDs - Parameter - Description - job_ids - Required list. A list of job ID strings - Returns:
- success object 
 
 - delete_attachment(job_id: str, attachment_id: str)
- Deletes a job attachment given a job ID and attachment ID - Parameter - Description - job_id - Required string. Job ID - attachment_id - Required string. Attachment ID - Returns:
- status code 
 
 - diagram(id: str)
- Returns the job diagram for the user-defined job - Parameter - Description - id - Required string. Job ID - Returns:
- Workflow Manager - Job Diagramobject
 
 - get(id: str, get_ext_props: bool = True, get_holds: bool = True)
- Returns an active job with the given ID - Parameter - Description - id - Required string. Job ID - get_ext_props - Optional Boolean. If set to false the object will not include the jobs extended properties. - get_holds - Optional Boolean. If set to false the object will not include the jobs holds. - Returns:
- Workflow Manager - JobObject
 
 - reopen(job_ids)
- Reopens a single or multiple jobs with specific Job IDs - Parameter - Description - job_ids - Required list of job ID strings - Returns:
- success object 
 
 - search(query: str | None = None, search_string: str | None = None, fields: str | None = None, display_names: str | None = [], sort_by: str | None = [], num: int = 10, start_num: int = 0)
- Runs a search against the jobs stored inside the Workflow Manager instance - Parameter - Description - query - Required string. SQL query to search against (e.g. “priority=’High’”) - search_str - Optional string. Search string to search against (e.g. “High”) - fields - Optional string. Field list to return - display_names - Optional string. Display names for the return fields - sort_by - Optional string. Field to sort by (e.g. {‘field’: ‘priority’, ‘sortOrder’: ‘Asc’}) - num - Optional Integer. Number of return results - start_num - Optional string. Index of first return value - Returns:
- List of search results 
 
 - set_job_location(job_id, geometry)
- Set a location of work for an existing job. jobUpdateLocation privilege is required to set a location on a job. - Parameter - Description - job_id - Required string. ID for the job to update - geometry - Required ArcGIS.Geometry.Geometry or Workflow Manager - JobLocationthat describes a Job’s Location. Must be a Polygon, Polyline, or Multipoint geometry type- Returns:
- success object 
 
 - statistics(query: str | None = None, search_str: str | None = None, group_by: str | None = None, spatial_extent: str | None = None, has_location: bool | None = None)
- Runs a search against the jobs stored inside the Workflow Manager instance - Parameter - Description - query - Optional string. The SQL query for the search you want total number of records for. (e.g. “priority=’High’”) Must specify either query or search_str as a parameter. - search_str - Optional string. The match criteria for a simple search. (e.g. “High”) Must specify either search_str or query as a parameter. - group_by - Optional string. The search field that is used to separate counts by value. - spatial_extent - Optional string. Spatial extent string to filter jobs by their locations - has_location - Optional boolean. If set to true jobs with defined location in jobLocation are returned - Returns:
- An object representing Workflow Manager job statistics 
 - # USAGE EXAMPLE # create a Workflow Manager object from the workflow item workflow_manager = WorkflowManager(wf_item) user_query = "diagramId='99o2QTePTqq-BHRHK_Aeag' " workflow_manager.jobs.statistics(query=user_query, group_by="assignedTo") # Example returned Job Statistics Object: { "total": 2, "groupBy": "assignedTo", "groupedValues": [ { "value": "assignedTo", count": 2 } ] } 
 - update(job_id: str, update_object: dict, allow_running_step_id: str | None = None)
- Updates a job object by ID - Parameter - Description - job_id - Required string. ID for the job to update - update_object - Required dictionary. A dictionary containing the fields and new values to add to the job. - allow_running_step_id - Optional string. Allow updating job properties when the specified step is running - Returns:
- success object 
 - # USAGE EXAMPLE: Updating a Job's properties # create a WorkflowManager object from the workflow item workflow_manager = WorkflowManager(wf_item) updates = { 'priority': 'High' } updates['extended_properties']: [ { "identifier": "table_name.prop1", "value": "updated_123" }, { "identifier": "table_name.prop2", "value": "updated_456" }, ] workflow_manager.jobs.update(job_id, updates, 'stepid123') 
 
Job
- class arcgis.gis.workflowmanager.Job(init_data, gis=None, url=None, workflow_manager=None)
- Bases: - object- Helper class for managing Workflow Manager jobs in a workflow item. This class is not created by users directly. An instance of this class, can be created by calling the - getmethod of the- JobManagerwith the appropriate job ID. The- JobManageris accessible as the- jobsproperty of the- WorkflowManager.- add_attachment(attachment: str, alias: str | None = None, folder: str | None = None)
- Adds an attachment to the job - Parameter - Description - attachment - Filepath to attachment - alias - Optional string. Alias for the attachment - folder - Optional string. Folder for the attachment - Returns:
- Job Attachment 
 
 - add_comment(comment: str)
- Adds a comment to the job - Parameter - Description - comment - Required string. Comment to add to job - Returns:
- Workflow Manager Comment Id 
 
 - add_hold(step_ids: list | None, dependent_job_id: str | None = None, dependent_step_id: str | None = None, hold_scheduled_release: str | None = None)
- Applies a hold or a dependency to a step. The Run and Finish actions cannot be performed on the step until the dependent step is resolved, the ReleaseHold action is run or the holdScheduledReleased has expired. If there is not a holdScheduledReleased timestamp, the ReleaseHold action is required to remove the hold or dependency. If there are multiple holds or dependencies, they must all be released or expired for the Run and Finish actions to be performed. Cannot be applied if the step is already running or job is closed. - Parameter - Description - step_ids - Optional. The array of steps put on hold when adding a dependency hold. If not specified, the dependency hold is applied to all the active steps in the job. - dependent_job_id - Optional. A job that the current job is dependent on from being performed step actions including Run and Finish - dependent_step_id - Optional. The step in the job that the current job is dependent on from being performed step actions including Run and Finish. - hold_scheduled_release - Optional. The release timestamp for a scheduled hold. Once the current date and time has passed the scheduled release timestamp, the hold will automatically release without requiring the ReleaseHold action. - Returns:
- success object 
 
 - add_linked_attachment(attachments: list)
- Add linked attachments to a job to provide additional or support information related to the job. Linked attachments can be links to a file on a local or shared file system or a URL. jobUpdateAttachments privilege is required to add an attachment to a job. - Parameter - Description - attachments - List of linked attachments to associate with the job. Each attachment should define the url, alias and folder - Returns:
- List list of job attachments 
 
 - property attachments
- Gets the attachments of a job given job ID - Returns:
- List of attachments 
 
 - property comments
- Gets the comments of a job given job ID - Returns:
- List of comments 
 
 - finish(step_ids: list | None = None)
- Finishes the current step(s). - The step will not be finished under the following conditions: - Not assigned to the current user 
- No active step is defined 
- The job is closed 
- A step that cannot be skipped and has not been started or has been cancelled, will not be finished 
- A step cannot be set current if the job is running. 
- A step that has one or more holds will not run nor finish. 
 - Argument - Description - step_ids - Optional list. The job’s active step ID or active parallel step IDs. If a step ID isn’t provided, the action is performed on the job’s current, active step(s). - Returns:
 - # USAGE EXAMPLE: Finish the current active steps # create a WorkflowManager object from the workflow item wm = WorkflowManager(wf_item) job = wm.jobs.get('job_id') # Will finish the current active steps, if no param is given finish_execution = job.finish() print(f'Result = { finish_execution.result() }') print(f'Status = { finish_execution.status }') print(f'Elapsed Time = { finish_execution.elapse_time }') print(f'Messages: ') for m in finish_execution.messages: print(m.message) 
 - get_attachment(attachment_id: str)
- Returns an embedded job attachment given an attachment ID - Parameter - Description - attachment_id - Attachment ID - Returns:
- Job Attachment 
 
 - property location
- Get/Set the job location for the user-defined job - Returns:
- Workflow Manager - JobLocationobject
 
 - release_hold(step_ids: list | None, dependent_job_id: str | None = None, dependent_step_id: str | None = None)
- Releases a hold from a step, allowing the Run and Finish actions to be once again performed on the step. - Parameter - Description - step_ids - Optional. The array of steps on hold to be released. If not specified the release is applied to all the steps on hold. - dependent_job_id - Optional. A job that the current job is dependent on from being performed step actions including Run and Finish. - dependent_step_id - Optional. The step in the job that the current job is dependent on from being performed step actions including Run and Finish. - Returns:
- success object 
 
 - run(step_ids: list | None = None)
- Starts running the current step(s). Running a step marks it as finished, if the step is set to proceed to next. - The step will not be started under the following conditions: - Not assigned to the current user 
- No active step is defined 
- The job is closed 
- A step that cannot be skipped and has not been started or has been cancelled, will not be finished 
- A step cannot be set current if the job is running. 
- A step that has one or more holds will not run nor finish. 
 - Argument - Description - step_ids - Optional list. The job’s active step ID or active parallel step IDs. If a step ID isn’t provided, the action is performed on the job’s current, active step(s). - Returns:
 - # USAGE EXAMPLE: Run the current active steps # create a WorkflowManager object from the workflow item wm = WorkflowManager(wf_item) job = wm.jobs.get('job_id') # Will run the current active steps, if no param is given, i.e job.run() run_execution = job.run(step_ids=['stepid']) print(f'Result = { run_execution.result() }') print(f'Status = { run_execution.status }') print(f'Elapsed Time = { run_execution.elapse_time }') print(f'Messages:') for m in run_execution.messages: print(m.message) 
 - set_current_step(step_id: str)
- Sets a single step to be the active step on the job. The ability to set a step as current is controlled by the workflowSetStepCurrent privilege. - Parameter - Description - step_id - Active Step ID - Returns:
- success object 
 
 - set_job_version(data_source_name=None, version_guid=None, version_name=None, administered=False, data_reference_id=None)
- Sets the version of the job. - Argument - Description - data_source_name - The name of the data source for the job version to be set. Required if the job diagram is using the data sources format. - version_guid - Optional. The guid of the version to be set. If the value is null or not defined, the versionName must be defined. versionGuid is preferred to be defined for better performance. - version_name - Optional. The name of the version to be set. If the value is null or not defined, the versionGuid must be defined. - administered - Optional. If true, the version can be claimed. If not defined, the default value is false. - data_reference_id - The id of the data reference for the job version to be set. Required if the job diagram is using the data references format. - Returns:
- success object 
 
 - stop(step_ids: list | None = None)
- Stops the current running step(s). The step(s) can be Run again or Finish can be used to complete it. In case of GP step and question step, the processing of the step is cancelled. In case of manual and open app step, the step is paused. The step can be forced to stop by a user not assigned to the step with the jobForceStop privilege. - The step will not be stopped under the following conditions: - Not assigned to the current user 
- No active step is defined 
- The job is closed 
- A step that cannot be skipped and has not been started or has been cancelled, will not be finished 
- A step cannot be set current if the job is running. 
- A step that has one or more holds will not run nor finish. 
 - Argument - Description - step_ids - Optional list. The job’s active step ID or active parallel step IDs. If a step ID isn’t provided, the action is performed on the job’s current, active step(s). - Returns:
 - # USAGE EXAMPLE: Stop the current active steps # create a WorkflowManager object from the workflow item wm = WorkflowManager(wf_item) job = wm.jobs.get('job_id') # Will stop the current active steps, if no param is given stop_execution = job.stop() print(f'Result = { stop_execution.result() }') print(f'Status = { stop_execution.status }') print(f'Elapsed Time = { stop_execution.elapse_time }') print(f'Messages: ') for m in stop_execution.messages: print(m.message) 
 - update_attachment(attachment_id: str, alias: str)
- Updates an attachment alias given a Job ID and attachment ID - Parameter - Description - attachment_id - Attachment ID - alias - Alias - Returns:
- success 
 
 - update_step(step_id: str, assigned_type: str, assigned_to: str)
- Update the assignment of the current step in a job based on the current user’s Workflow Manager assignment privileges - Parameter - Description - step_id - Required String. Active Step ID - assigned_type - Required String. Type of assignment designated Values: “User” | “Group” | “Unassigned” - assigned_to - Required String. User id to which the active step is assigned - Returns:
- success object 
 - # USAGE EXAMPLE: Updating a step assignment # create a WorkflowManager object from the workflow item wm = WorkflowManager(wf_item) job = wm.jobs.get('job_id') job.update_step(step_id='123456', assigned_type='User', assigned_to='my_user') 
 
JobDiagram
- class arcgis.gis.workflowmanager.JobDiagram(init_data, gis=None, url=None)
- Bases: - object- Helper class for managing Workflow Manager - job diagramsin a workflow- item. This class is not created directly. An instance can be created by calling the- diagramsproperty of the- WorkflowManagerto retrieve a list of diagrams. Then the- diagram()method can be used with the appropriate ID of the diagram to retrieve the- job diagram.
JobLocation
JobTemplate
- class arcgis.gis.workflowmanager.JobTemplate(init_data, gis=None, url=None)
- Bases: - object- Represents a Workflow Manager Job Template object with accompanying GET, POST, and DELETE methods - Parameter - Description - init_data - data object representing relevant parameters for GET or POST calls - automated_creation(automation_id)
- Returns the specified automated creation - Parameter - Description - automation_id - Required string. Automation Creation Id - Returns:
- automated creation object. 
 
 - property automated_creations
- Retrieve the list of created automations for a job template, including scheduled job creation and webhook. - Returns:
- list of automatedCreations associated with the JobTemplate 
 
 - Shares a job template with the list of groups - Parameter - Description - group_ids - Required list. List of Workflow Group Ids - Returns:
- boolean 
 
 - Returns the list of groups that the job_template is shared with by template_id. - Returns:
- list of - GroupID
 
 - update_automated_creation(adds=None, updates=None, deletes=None)
- Creates an automated creation - Parameter - Description - adds - Optional List. The list of automated creations to create. - updates - Optional List. The list of automated creations to update - deletes - Optional List. The list of automated creation ids to delete - Returns:
- success object 
 - # USAGE EXAMPLE: Creating an automated creation for a job template # create a WorkflowManager object from the workflow item wm = WorkflowManager(wf_item) # create the props object with the required automation properties adds = [{ "automationName": "auto_mation", "automationType": "Scheduled", "enabled": True, "details": "{"timeType":"NumberOfDays","dayOfMonth":1,"hour":8,"minutes":0}" }] updates = [ { "automationId": "abc123", "automationName": "automation_updated" } ] deletes = ["def456"] wm.update_automated_creation(adds, updates, deletes) >> True # returns true if created successfully 
 
Group
SavedSearchesManager
- class arcgis.gis.workflowmanager.SavedSearchesManager(item)
- Bases: - object- Represents a helper class for Workflow Manager saved searches. Accessible as the - saved_searchesproperty.- Parameter - Description - item - The Workflow Manager Item - create(name: str, search_type: str, folder: str | None = None, definition: str | None = None, color_ramp: str | None = None, sort_index: str | None = None, search_id: str | None = None)
- Create a saved search or chart by specifying the search parameters in the json body. All search properties except for optional properties must be passed in the body to save the search or chart. The adminAdvanced or adminBasic privilege is required. - Parameter - Description - name - Required string. The display name for the saved search or chart. - search_type - Required string. The type for the saved search or chart. The accepted values are Standard, Chart and All. - folder - Optional string. The folder the saved search or chart will be categorized under. - definition - Required string. if the searchType is Standard. The search definition to be saved. - color_ramp - Required string. if the searchType is Chart. The color ramp for the saved chart. - sort_index - Optional string. The sorting order for the saved search or chart. - search_id - Optional string. The unique ID of the search or chart to be created. - Returns:
- Saved Search ID 
 
 - delete(id: str)
- Deletes a saved search by ID - Parameter - Description - id - Required string. Saved Search id - Returns:
- Boolean 
 
 - Shares a saved search with the list of groups - Parameter - Description - search_id - Required string. Saved Search id - group_ids - Required list. List of Workflow Group Ids - Returns:
- Boolean 
 
 - Returns the list of groups that the saved search is shared with by searchId. - Parameter - Description - search_id - Search ID - Returns:
- List of - GroupID
 
 - update(search)
- Update a saved search or chart by specifying the update values in the json body. All the properties except for optional properties must be passed in the body to update the search or chart. The searchId cannot be updated once it is created. The adminAdvanced or adminBasic privilege is required. - Parameter - Description - search - Required object. An object defining the properties of the search to be updated. - Returns:
- success object 
 - # USAGE EXAMPLE: Updating a search's properties # create a WorkflowManager object from the workflow item workflow_manager = WorkflowManager(wf_item) workflow_manager.create_saved_search(name="name", definition={ "start": 0, "fields": ["job_status"], "displayNames": ["Status" ], "sortFields": [{"field": "job_status", "sortOrder": "Asc:}] }, search_type='Chart', color_ramp='Flower Field Inverse', sort_index=2000) search_lst = workflow_manager.searches("All") search = [x for x in search_lst if x["searchId"] == searchid][0] search["colorRamp"] = "Default" search["name"] = "Updated search" actual = workflow_manager.update_saved_search(search) 
 
LookUpTable
- class arcgis.gis.workflowmanager.LookUpTable(init_data, gis=None, url=None)
- Bases: - object- Represents a Workflow Manager Look Up object with accompanying GET, POST, and DELETE methods. - Parameter - Description - init_data - data object containing the relevant properties for a LookUpTable to complete REST calls 
Template
- class arcgis.gis.workflowmanager.Template(template_name, template_id, template_details, gis=None, url=None)
- Bases: - object- Represents a Workflow Manager Template object with accompanying GET, POST, and DELETE methods. - Parameter - Description - template_name - The template name - template_details - The details of the template - template_id - The template ID 
WMRole
Notification
- class arcgis.gis.workflowmanager.Notification(init_data)
- Bases: - object- Represents a Workflow Manager Notification object. The Notification contains the - MessageType, the message object and the timestamp the notification was received- Parameter - Description - init_data - data object representing relevant properties of a notification - # USAGE EXAMPLE: Print Notification Properties # create a WorkflowManager object from the workflow item wm = WorkflowManager(wf_item) job = wm.jobs.get('job_id') run_execution = job.run(step_ids=['stepid']) print(f'Result = { run_execution.result() }') print(f'Messages:') for m in run_execution.messages: print(m.msg_type) print(m.message) print(m.timestamp) 
JobExecution
- class arcgis.gis.workflowmanager.JobExecution(job: Job, execution_type: ExecutionType)
- Bases: - WorkflowManagerExecution- Represents a single step executing in a Workflow Manager job. The JobExecution class allows for the asynchronous operation of an executing step. The status of the step execution can then be queried by the class properties, status, result, elapse_time and messages. This class is not intended for users to call directly. - See - run,- stopor- finishfor examples.- Parameter - Description - job - Required - JobThe job to execute- execution_type - Required - ExecutionType. The execution type
ItemExecution
- class arcgis.gis.workflowmanager.ItemExecution(item, execution_type: ExecutionType)
- Bases: - WorkflowManagerExecution- Represents some execution on the workflow item level. The ItemExecution class allows for the asynchronous operation of an executing Workflow Manager admin operations. The status of the step execution can then be queried by the class properties, status, result, elapse_time and messages. This class is not intended for users to call directly. - Parameter - Description - item - Required Item. The Workflow Manager Item to be imported or exported - execution_type - Required - ExecutionType. The execution type