Workflow
require(["esri/widgets/Editor/Workflow"], function(Workflow) { /* code goes here */ });esri/widgets/Editor/Workflow- Overview
- Workflow - add a new feature
- Workflow - update a single feature
- Workflow - update multiple features
Overview
A Workflow helps manage different stages of an editing workflow. A workflow can be thought of as one of two options: create and/or update. If adding a new feature, the create option is used. Whereas if editing an existing feature, the update option is used. Updating includes both editing geometry and attribute data and deleting features.
An instance of a Workflow is accessed via the activeWorkflow property in either the Editor or EditorViewModel classes.
These workflows are only enabled if the feature service allows these operations. For example, if a feature service is only enabled to allow updates, it is not possible to override this using the API.
Read more
Add a new feature
The following stages depict adding a new feature in the create workflow.

| Stage | Add feature example | 
|---|---|
| 1 - After selecting Add feature, the first panel contains the CreateWorkflowData.viewModel. |  | 
| 2 - After a template is selected, the next panel has access to CreateWorkflowData.creationInfo and CreateWorkflowData.viewModel. |  | 
| 3 - Once a feature geometry is specified, the subsequent attribute panel has access to CreateWorkflowData.creationInfo, UpdateWorkflowData.edits, and CreateWorkflowData.viewModel. |  | 
Update a single feature

The following stages depict editing a single feature.
| Stage | Edit single feature example | 
|---|---|
| 1 - After selecting Edit feature, the initial panel contains the UpdateWorkflowData.viewModel. |  | 
| 2 - Once a feature is selected, the subsequent attribute panel has access to UpdateWorkflowData.edits, UpdateWorkflowData.editableItem, and UpdateWorkflowData.viewModel. |  | 
Update multiple features
The following stages depict editing multiple features.
| Stage | edit multiple features example | 
|---|---|
| 1 - After selecting Edit feature, the initial panel contains the UpdateWorkflowData.viewModel. |  | 
| 2 - If multiple features are selected, the subsequent attribute panel has access to UpdateWorkflowData.candidates and UpdateWorkflowData.viewModel. |  | 
| 3 - Once a feature is selected, the subsequent attribute panel has access to UpdateWorkflowData.edits, UpdateWorkflowData.editableItem, and UpdateWorkflowData.viewModel. |  | 
Constructors
- new Workflow(properties)
- Parameter:properties ObjectoptionalSee the properties for a list of all the properties that may be passed into the constructor. 
Property Overview
| Name | Type | Summary | Class | |
|---|---|---|---|---|
| CreateWorkflowData|UpdateWorkflowData | Shared workflow data.more details | more details | Workflow | |
| String | The name of the class.more details | more details | Accessor | |
| Boolean | This property indicates whether there is a next step in the workflow.more details | more details | Workflow | |
| Boolean | This property indicates if there is a previous step in the workflow.more details | more details | Workflow | |
| Boolean | Indicates whether the workflow is considered active.more details | more details | Workflow | |
| String | The name of the current step in the workflow.more details | more details | Workflow | |
| String | Value indicating the workflow type.more details | more details | Workflow | 
Property Details
- Shared workflow data. Can be either a CreateWorkflowData or a UpdateWorkflowData. 
- The name of the class. The declared class name is formatted as - esri.folder.className.
- hasNextStep Booleanreadonly
- This property indicates whether there is a next step in the workflow. 
- hasPreviousStep Booleanreadonly
- This property indicates if there is a previous step in the workflow. 
- started Booleanreadonly
- Indicates whether the workflow is considered active. - Default Value:false
 
- stepId Stringreadonly
- The name of the current step in the workflow. 
- type Stringreadonly
- Value indicating the workflow type. - Possible Value - Description - Example - create - Indicated in the widget via the - Add featureoption. This allows the end user to create new features in the feature service. - update - Indicated in the widget via the - Edit featureoption. This allows the end user to update and/or delete features in the feature service. - These workflows are only enabled if the feature service allows these operations. For example, if a feature service is only enabled to allow updates, - Add featuresis not enabled.
Method Overview
| Name | Return Type | Summary | Class | |
|---|---|---|---|---|
| Cancels the active workflow.more details | more details | Workflow | ||
| Call this method when the workflow is considered finished.more details | more details | Workflow | ||
| Moves to the next step in the workflow.more details | more details | Workflow | ||
| Moves to the previous step in the workflow.more details | more details | Workflow | ||
| Resets the workflow.more details | more details | Workflow | ||
| Starts the workflow.more details | more details | Workflow | 
Method Details
- cancel()
- Cancels the active workflow. 
- commit()
- Call this method when the workflow is considered finished. This method is used to help process the editing results. 
- next()
- Moves to the next step in the workflow. 
- previous()
- Moves to the previous step in the workflow. 
- reset()
- Resets the workflow. 
- start()
- Starts the workflow. 
Type Definitions
- CreateWorkflowData
- This object contains data for the - createworkflow.- Properties:
- creationInfo CreationInfoThe creationInfo provides the feature template and layer when creating a new feature. edits EditsThe edits used to keep track of a feature being modified. viewModel EditorViewModelThe associated EditorViewModel for this workflow. 
 
- Edits
- Object used to keep track of a feature being modified. 
- UpdateWorkflowData
- This object contains data for the - updateworkflow.- Properties:
- An array of features to be updated. This is only relevant when there are multiple candidates to update. editableItem EditableItem- The object that matches the feature being updated. edits Edits- The edits used to keep track of a feature being modified. viewModel EditorViewModel- The associated EditorViewModel for this workflow.