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.
WorkflowManagerBases: 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
Get portal groups associated with Workflow Manager roles, to which the current user can assign work based on their Workflow Manager assignment privileges.
Get all assignable users for a user in the workflow system
A list of the assignable user
objects
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
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.
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
Workflow Manager JobTemplate
ID
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
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
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
Workflow Manager Template
ID
# 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
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
Workflow Manager WMRole
Object
Deletes a diagram object by ID
Parameter
Description
id
Required string. Diagram id
Deletes a diagram version by ID
Parameter
Description
diagram_id
Required string. Diagram ID
version_id
Required string. Diagram Version ID
Boolean
Deletes a job template with the given ID
Parameter
Description
id
Required string. Job Template ID
status code
Deletes a job template with the given ID
Parameter
Description
lookup_type
Required string. The type of lookup table stored in the workflow item.
status code
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
Boolean
Returns boolean indicating whether or not the role was deleted.
Parameter
Description
name
Required string. Role Name
Boolean
Returns the diagram
with the given ID
Parameter
Description
id
Required string. Diagram ID
Workflow Manager JobDiagram
Object
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
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": [] }
Returns the diagram
with the given version ID
Parameter
Description
diagram_id
Required string. Diagram ID
version_id
Required string. Diagram Version ID
Specified version of the Workflow Manager JobDiagram
object
Gets the workflow diagrams within the workflow item.
Evaluates an arcade expression
Parameter
Description
expression
Required String.
context
Optional String.
context_type
Optional String.
mode
Optional String.
String
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
Workflow Manager Template
Object
# 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 } }
Returns group information with the given group ID
Parameter
Description
group_id
Required string. Workflow Manager Group ID
Workflow Manager Group
Object
Returns a job template with the given ID
Parameter
Description
id
Required string. Job Template ID
Workflow Manager JobTemplate
Object
Gets all the job templates in a workflow item.
List of all current job templates
in the Workflow Manager (required information for create_job call).
The job manager for a workflow item.
JobManager
object
Returns LookUp Tables by given type
Parameter
Description
lookup_type
Required string. The type of lookup table stored in the workflow item.
Workflow Manager LookUpTable
Object
The Saved Searches manager for a workflow item.
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 a list of all settings for the Workflow Manager instance
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 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.
Workflow Manager Template
List
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)
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 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 Group
ID
update_object
Required object. Object containing the updated actions of the information to be taken to the portal group.
Boolean
Updates a job template object by ID
Parameter
Description
template
Required object. Job Template
body. Existing Job Template object that inherits required/optional fields.
success object
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â})
success object
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
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
Returns a user profile with the given username
Parameter
Description
username
Required string. Workflow Manager Username
Workflow Manager user profile
Returns an list of all user profiles stored in Workflow Manager
List of user
profiles
Returns an active role with the given name
Parameter
Description
name
Required string. Role Name
Workflow Manager Role
Object
Returns a list of user roles
available in the local Workflow Manager instance.
List
Bases: object
Represents a series of CRUD functions for Workflow Manager Items
Parameter
Description
gis
Optional GIS. The connection to the Enterprise.
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.
string (item_id)
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
success object
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.
success object
Checks the health of Workflow Manager Server and if the cluster is active (if applicable).
Boolean
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.
success object
Gets the current status of the Workflow Manager Server
Boolean
Upgrades an outdated Workflow Manager schema. Requires the Workflow Manager Advanced Administrator privilege or the Portal Admin Update Content privilege.
Parameter
Description
item
Required Item. The Workflow Manager Item to be upgraded
success object
Bases: object
Represents a helper class for workflow manager jobs. Accessible as the jobs
property of the WorkflowManager
.
Closes a single or multiple jobs with specific Job IDs
Parameter
Description
job_ids
Required list of job ID strings
success object
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 JobLocation
Define 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.
List of newly created job ids
Deletes a single or multiple jobs with specific JobIDs
Parameter
Description
job_ids
Required list. A list of job ID strings
success object
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
status code
Returns the job diagram for the user-defined job
Parameter
Description
id
Required string. Job ID
Workflow Manager Job Diagram
object
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.
Workflow Manager Job
Object
Reopens a single or multiple jobs with specific Job IDs
Parameter
Description
job_ids
Required list of job ID strings
success object
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
List of search results
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 JobLocation
that describes a Jobâs Location. Must be a Polygon, Polyline, or Multipoint geometry type
success object
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
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 } ] }
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
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')
Upgrades a single or multiple jobs with specific JobIDs
Parameter
Description
job_ids
Required list. A list of job ID strings
success object
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 get
method of the JobManager
with the appropriate job ID. The JobManager
is accessible as the jobs
property of the WorkflowManager
.
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
Job Attachment
Adds a comment to the job
Parameter
Description
comment
Required string. Comment to add to job
Workflow Manager Comment Id
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.
success object
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
List list of job attachments
Gets the attachments of a job given job ID
List of attachments
Gets the comments of a job given job ID
List of comments
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).
# 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)
Returns an embedded job attachment given an attachment ID
Parameter
Description
attachment_id
Attachment ID
Job Attachment
Gets the history of a job given job ID
success object
Get/Set the job location for the user-defined job
Workflow Manager JobLocation
object
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.
success object
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).
# 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)
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
success object
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.
success object
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).
# 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)
Updates an attachment alias given a Job ID and attachment ID
Parameter
Description
attachment_id
Attachment ID
alias
Alias
success
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
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')
Bases: object
Helper class for managing Workflow Manager job diagrams
in a workflow item
. This class is not created directly. An instance can be created by calling the diagrams
property of the WorkflowManager
to retrieve a list of diagrams. Then the diagram()
method can be used with the appropriate ID of the diagram to retrieve the job diagram
.
Bases: object
Represents a Workflow Manager Job Location object with accompanying GET, POST, and DELETE methods
Parameter
Description
init_data
Required object. Represents. relevant parameters for GET or POST calls
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
Returns the specified automated creation
Parameter
Description
automation_id
Required string. Automation Creation Id
automated creation object.
Retrieve the list of created automations for a job template, including scheduled job creation and webhook.
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
boolean
Returns the list of groups that the job_template is shared with by template_id.
list of Group
ID
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
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
Bases: object
Represents a Workflow Manager Group object with accompanying GET, POST, and DELETE methods
Parameter
Description
init_data
data object representing relevant parameters for GET or POST calls
Bases: object
Represents a helper class for workflow manager saved searches. Accessible as the saved_searches
property.
Parameter
Description
item
The Workflow Manager Item
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.
Saved Search ID
Deletes a saved search by ID
Parameter
Description
id
Required string. Saved Search id
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
Boolean
Returns the list of groups that the saved search is shared with by searchId.
Parameter
Description
search_id
Search ID
List of Group
ID
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.
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)
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
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
Bases: object
Represents a Workflow Manager Role object with accompanying GET, POST, and DELETE methods
Parameter
Description
init_data
data object representing relevant parameters for GET or POST calls
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)
Bases: object
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
, stop
or finish
for examples.
Parameter
Description
job
Required Job
The job to execute
execution_type
Required ExecutionType
. The execution type
Returns a boolean indicating whether the execution is done.
boolean
Get the amount of time that passed while the JobExecution
ran.
Gets the messages collected during execution
List of Notification
Returns the last Notification
message received at the end of the execution
Parameter
Description
timeout
Optional integer. The timeout argument specifies a timeout for the operation in seconds.
string
Returns a boolean indicating whether the execution is running.
boolean
Returns the execution status
string
Bases: Enum
The Workflow Manager Message Types
This enum class represents the list of all possible message types when sending or receiving messages.
Bases: Enum
The Workflow Manager Execution Statuses
This enum class represents the possible step execution statuses.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4