# IRPCWorkflowsAdmin.ModifyWorkflow

Location: [gRPC API](https://developer.m-files.com/APIs/gRPC-API/index.md) > [Administration API](https://developer.m-files.com/APIs/gRPC-API/admin/index.md) > [Workflow administration](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCWorkflowsAdmin/index.md)

HTML version: https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCWorkflowsAdmin/ModifyWorkflow/

Badges: `Administration API / specialized` `admin` `session`

Saves a changed workflow with its states and transitions.

- **Service:** [Workflow administration](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCWorkflowsAdmin/index.md) `MFiles.IRPCWorkflowsAdmin`
- **gRPC method:** `/MFiles.IRPCWorkflowsAdmin/ModifyWorkflow`
- **HTTP (mf-http-grpc):** `POST /grpc/v1/modify-workflow`
- **Request:** [`ModifyWorkflowRequest`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCWorkflowsAdmin/ModifyWorkflow/index.md#request)
- **Response:** [`ModifyWorkflowResponse`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCWorkflowsAdmin/ModifyWorkflow/index.md#response)
- **Book and level:** Administration API, specialized
- **Kind:** admin
- **Session:** Required: the session ID from LogIn in the mfiles-session-id-bin metadata.
- **Idempotent:** no
- **Returns metadata structure version:** no
- **Streaming:** none (unary)

<a id="remarks"></a>

## Remarks

- Same rights, code rules and language rule as
  [AddWorkflow](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCWorkflowsAdmin/AddWorkflow/index.md).
- Send the complete workflow: start from
  [GetWorkflows](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCWorkflowsAdmin/GetWorkflows/index.md). Existing states and transitions
  keep their IDs; new ones use negative placeholder IDs.
- Increments the metadata structure version.

<a id="request"></a>

## Request: ModifyWorkflowRequest

> Nested message fields are expanded to depth 3; follow a type link for deeper levels and for the type's own page. Fields marked (recursive) refer to a type already on their path.

| Field | Type | Description |
|---|---|---|
| `workflow` | [`WorkflowAdmin`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.WorkflowAdmin/index.md) | The complete new workflow; `workflow.workflow.id` identifies it. |
| `workflow.workflow` | [`Workflow`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.Workflow/index.md) | Basic information on the workflow. |
| `workflow.workflow.id` | `int32` | Workflow ID. |
| `workflow.workflow.name` | `string` | The name of the workflow. |
| `workflow.workflow.object_class_id` | `int32` | The class this workflow can be used with. |
| `workflow.workflow.description` | `string` | The user description of the workflow. |
| `workflow.workflow.reserved1_obsolete` | `uint32` | Reserved, must be zero. |
| `workflow.workflow.reserved2_obsolete` | `uint32` | Reserved, must be zero. |
| `workflow.description` | `string` | The description of the workflow. |
| `workflow.states[]` | repeated [`State`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.State/index.md) | The states of this workflow. |
| `workflow.states[].id` | `int32` | State ID. |
| `workflow.states[].name` | `string` | The name of the state. |
| `workflow.states[].description` | `string` | The description of the state. |
| `workflow.states[].options` | [`ACTIONFLAGS`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ACTIONFLAGS/index.md) | Flags that tell which actions are enabled for this state. |
| `workflow.states[].action_set_acl` | [`ActionSetACL`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ActionSetACL/index.md) | The properties of the Set Permissions action. |
| `workflow.states[].action_assign_to_user` | [`ActionSetAssignment`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ActionSetAssignment/index.md) | The properties of the Assign to User action. |
| `workflow.states[].actions[]` | repeated [`ActionSetAssignment`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ActionSetAssignment/index.md) | Action array. |
| `workflow.states[].action_send_notification` | [`ActionSendNotification`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ActionSendNotification/index.md) | The properties of the Send Notification action. |
| `workflow.states[].action_set_properties` | [`ActionSetProperties`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ActionSetProperties/index.md) | Action: set properties. |
| `workflow.states[].action_convert_to_pdf` | [`ActionConvertToPDF`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ActionConvertToPDF/index.md) | Action: convert to PDF. |
| `workflow.states[].action_code` | `string` | Action: run VBScript code. |
| `workflow.states[].restrict_transitions` | `bool` | True if transitions involving this state must be individually allowed. |
| `workflow.states[].transitions_require_edit_access_to_object` | `bool` | True if state transitions require edit access to the object. |
| `workflow.states[].check_in_out_acl` | `bool` | True if the in/out permissions of this state should be checked. |
| `workflow.states[].in_out_acl` | [`AccessControlList`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.AccessControlList/index.md) | The in/out permissions of this state. |
| `workflow.states[].preconditions` | [`StateConditions`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.StateConditions/index.md) | State preconditions. (rules) |
| `workflow.states[].postconditions` | [`StateConditions`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.StateConditions/index.md) | State postconditions. (rules) |
| `workflow.states[].aliases` | `string` | Semicolon-separated list of semantic aliases. |
| `workflow.states[].user_description` | `string` | The user description of the state. |
| `workflow.states[].state_flags` | [`STATEFLAGS`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.STATEFLAGS/index.md) | Flags that tell different options set for this state. |
| `workflow.states[].agent_action_guid` | `string` | The agent action GUID of the state, or GUID_NULL if not set. |
| `workflow.transitions[]` | repeated [`StateTransition`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.StateTransition/index.md) | The state transitions of this workflow. |
| `workflow.transitions[].id` | `int32` | State transition ID. |
| `workflow.transitions[].from_state` | `int32` | The source state. |
| `workflow.transitions[].to_state` | `int32` | The target state. |
| `workflow.transitions[].evaluation_order` | `int32` | The evaluation order. |
| `workflow.transitions[].name` | `string` | The name of the state. |
| `workflow.transitions[].description` | `string` | The description of the state. |
| `workflow.transitions[].acl` | [`AccessControlList`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.AccessControlList/index.md) | Transition permissions. |
| `workflow.transitions[].signature_settings` | [`ElectronicSignatureSettings`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ElectronicSignatureSettings/index.md) | Signature settings for this state transition. |
| `workflow.transitions[].trigger_mode` | [`AutoStateTransitionMode`](https://developer.m-files.com/APIs/gRPC-API/Reference/Enums/MFiles.AutoStateTransitionMode/index.md) | The selected mode for automatically triggered state transition. Values: `AUTO_STATE_TRANSITION_MODE_NONE` (0), `AUTO_STATE_TRANSITION_MODE_RELATIVE_TIME` (1), `AUTO_STATE_TRANSITION_MODE_CRITERIA_FULFILLED` (4), `AUTO_STATE_TRANSITION_MODE_SCRIPT_FULFILLED` (5), `AUTO_STATE_TRANSITION_MODE_ASSIGNMENT_COMPLETE` (6), `AUTO_STATE_TRANSITION_MODE_ASSIGNMENT_REJECTED` (7). |
| `workflow.transitions[].trigger_in_days` | `uint32` | The number of days before automatically triggered state transition. |
| `workflow.transitions[].trigger_criteria[]` | repeated [`SearchCondition`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.SearchCondition/index.md) | The criteria for automatically triggered state transition. |
| `workflow.transitions[].trigger_code` | `string` | The VB script for automatically triggered state transition. |
| `workflow.transitions[].aliases` | `string` | Semicolon-separated list of semantic aliases. |
| `workflow.transitions[].vault_guids[]` | repeated `string` | An array of GUIDS of vaults where this state transition will be triggered. |
| `workflow.transitions[].user_description` | `string` | The user description of the state. |
| `workflow.acl` | [`AccessControlList`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.AccessControlList/index.md) | Permissions. |
| `workflow.acl.checked_out_to_user` | `int32` | Specifies the ID of the user who has extended rights because of the checkout operation performed by her. 0 if such user does not exist. |
| `workflow.acl.is_fully_authoritative` | `bool` | Specifies whether this access control list is set to ignore the secondary permissions that come from the latest checked in version. |
| `workflow.acl.custom_component` | [`AccessControlListComponent`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.AccessControlListComponent/index.md) | Accesses the custom component of this ACL. |
| `workflow.acl.restrictive_components[]` | repeated [`AccessControlListComponentMapEntry`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.AccessControlListComponentMapEntry/index.md) | Accesses the restrictive automatic components of this ACL. |
| `workflow.acl.secondary_access_control_list` | [`AccessControlList`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.AccessControlList/index.md) (recursive) | Secondary ACL used for latest version ACL. Not used for access check if null. |
| `workflow.acl.additive_components[]` | repeated [`AccessControlListComponentMapEntry`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.AccessControlListComponentMapEntry/index.md) | Accesses the additive automatic components of this ACL. |
| `workflow.aliases` | `string` | Semicolon-separated list of semantic aliases. |
| `workflow.graphical_layout_data` | `string` | Layout data of the workflow. |

<a id="response"></a>

## Response: ModifyWorkflowResponse

> Nested message fields are expanded to depth 3; follow a type link for deeper levels and for the type's own page. Fields marked (recursive) refer to a type already on their path.

| Field | Type | Description |
|---|---|---|
| `workflow_result` | [`WorkflowAdmin`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.WorkflowAdmin/index.md) | The workflow as stored, with real IDs for new states and transitions. |
| `workflow_result.workflow` | [`Workflow`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.Workflow/index.md) | Basic information on the workflow. |
| `workflow_result.workflow.id` | `int32` | Workflow ID. |
| `workflow_result.workflow.name` | `string` | The name of the workflow. |
| `workflow_result.workflow.object_class_id` | `int32` | The class this workflow can be used with. |
| `workflow_result.workflow.description` | `string` | The user description of the workflow. |
| `workflow_result.workflow.reserved1_obsolete` | `uint32` | Reserved, must be zero. |
| `workflow_result.workflow.reserved2_obsolete` | `uint32` | Reserved, must be zero. |
| `workflow_result.description` | `string` | The description of the workflow. |
| `workflow_result.states[]` | repeated [`State`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.State/index.md) | The states of this workflow. |
| `workflow_result.states[].id` | `int32` | State ID. |
| `workflow_result.states[].name` | `string` | The name of the state. |
| `workflow_result.states[].description` | `string` | The description of the state. |
| `workflow_result.states[].options` | [`ACTIONFLAGS`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ACTIONFLAGS/index.md) | Flags that tell which actions are enabled for this state. |
| `workflow_result.states[].action_set_acl` | [`ActionSetACL`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ActionSetACL/index.md) | The properties of the Set Permissions action. |
| `workflow_result.states[].action_assign_to_user` | [`ActionSetAssignment`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ActionSetAssignment/index.md) | The properties of the Assign to User action. |
| `workflow_result.states[].actions[]` | repeated [`ActionSetAssignment`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ActionSetAssignment/index.md) | Action array. |
| `workflow_result.states[].action_send_notification` | [`ActionSendNotification`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ActionSendNotification/index.md) | The properties of the Send Notification action. |
| `workflow_result.states[].action_set_properties` | [`ActionSetProperties`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ActionSetProperties/index.md) | Action: set properties. |
| `workflow_result.states[].action_convert_to_pdf` | [`ActionConvertToPDF`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ActionConvertToPDF/index.md) | Action: convert to PDF. |
| `workflow_result.states[].action_code` | `string` | Action: run VBScript code. |
| `workflow_result.states[].restrict_transitions` | `bool` | True if transitions involving this state must be individually allowed. |
| `workflow_result.states[].transitions_require_edit_access_to_object` | `bool` | True if state transitions require edit access to the object. |
| `workflow_result.states[].check_in_out_acl` | `bool` | True if the in/out permissions of this state should be checked. |
| `workflow_result.states[].in_out_acl` | [`AccessControlList`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.AccessControlList/index.md) | The in/out permissions of this state. |
| `workflow_result.states[].preconditions` | [`StateConditions`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.StateConditions/index.md) | State preconditions. (rules) |
| `workflow_result.states[].postconditions` | [`StateConditions`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.StateConditions/index.md) | State postconditions. (rules) |
| `workflow_result.states[].aliases` | `string` | Semicolon-separated list of semantic aliases. |
| `workflow_result.states[].user_description` | `string` | The user description of the state. |
| `workflow_result.states[].state_flags` | [`STATEFLAGS`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.STATEFLAGS/index.md) | Flags that tell different options set for this state. |
| `workflow_result.states[].agent_action_guid` | `string` | The agent action GUID of the state, or GUID_NULL if not set. |
| `workflow_result.transitions[]` | repeated [`StateTransition`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.StateTransition/index.md) | The state transitions of this workflow. |
| `workflow_result.transitions[].id` | `int32` | State transition ID. |
| `workflow_result.transitions[].from_state` | `int32` | The source state. |
| `workflow_result.transitions[].to_state` | `int32` | The target state. |
| `workflow_result.transitions[].evaluation_order` | `int32` | The evaluation order. |
| `workflow_result.transitions[].name` | `string` | The name of the state. |
| `workflow_result.transitions[].description` | `string` | The description of the state. |
| `workflow_result.transitions[].acl` | [`AccessControlList`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.AccessControlList/index.md) | Transition permissions. |
| `workflow_result.transitions[].signature_settings` | [`ElectronicSignatureSettings`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ElectronicSignatureSettings/index.md) | Signature settings for this state transition. |
| `workflow_result.transitions[].trigger_mode` | [`AutoStateTransitionMode`](https://developer.m-files.com/APIs/gRPC-API/Reference/Enums/MFiles.AutoStateTransitionMode/index.md) | The selected mode for automatically triggered state transition. Values: `AUTO_STATE_TRANSITION_MODE_NONE` (0), `AUTO_STATE_TRANSITION_MODE_RELATIVE_TIME` (1), `AUTO_STATE_TRANSITION_MODE_CRITERIA_FULFILLED` (4), `AUTO_STATE_TRANSITION_MODE_SCRIPT_FULFILLED` (5), `AUTO_STATE_TRANSITION_MODE_ASSIGNMENT_COMPLETE` (6), `AUTO_STATE_TRANSITION_MODE_ASSIGNMENT_REJECTED` (7). |
| `workflow_result.transitions[].trigger_in_days` | `uint32` | The number of days before automatically triggered state transition. |
| `workflow_result.transitions[].trigger_criteria[]` | repeated [`SearchCondition`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.SearchCondition/index.md) | The criteria for automatically triggered state transition. |
| `workflow_result.transitions[].trigger_code` | `string` | The VB script for automatically triggered state transition. |
| `workflow_result.transitions[].aliases` | `string` | Semicolon-separated list of semantic aliases. |
| `workflow_result.transitions[].vault_guids[]` | repeated `string` | An array of GUIDS of vaults where this state transition will be triggered. |
| `workflow_result.transitions[].user_description` | `string` | The user description of the state. |
| `workflow_result.acl` | [`AccessControlList`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.AccessControlList/index.md) | Permissions. |
| `workflow_result.acl.checked_out_to_user` | `int32` | Specifies the ID of the user who has extended rights because of the checkout operation performed by her. 0 if such user does not exist. |
| `workflow_result.acl.is_fully_authoritative` | `bool` | Specifies whether this access control list is set to ignore the secondary permissions that come from the latest checked in version. |
| `workflow_result.acl.custom_component` | [`AccessControlListComponent`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.AccessControlListComponent/index.md) | Accesses the custom component of this ACL. |
| `workflow_result.acl.restrictive_components[]` | repeated [`AccessControlListComponentMapEntry`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.AccessControlListComponentMapEntry/index.md) | Accesses the restrictive automatic components of this ACL. |
| `workflow_result.acl.secondary_access_control_list` | [`AccessControlList`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.AccessControlList/index.md) (recursive) | Secondary ACL used for latest version ACL. Not used for access check if null. |
| `workflow_result.acl.additive_components[]` | repeated [`AccessControlListComponentMapEntry`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.AccessControlListComponentMapEntry/index.md) | Accesses the additive automatic components of this ACL. |
| `workflow_result.aliases` | `string` | Semicolon-separated list of semantic aliases. |
| `workflow_result.graphical_layout_data` | `string` | Layout data of the workflow. |

<a id="related"></a>

## Related methods

- [AddWorkflow](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCWorkflowsAdmin/AddWorkflow/index.md): Creates a workflow with its states and transitions.
- [GetWorkflows](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCWorkflowsAdmin/GetWorkflows/index.md): Gets the full administrative definitions of all workflows.
