Integrating Office Online with document workflow processes

Pre-release Feature

This documentation is for an upcoming feature and may undergo dramatic changes prior to final release. Pre-release features are available in the Test environment only.

Hosts can integrate Office Online into workflow processes, so that users can use UI directly in Office Online to manage documents in a workflow.

For example, consider a host that caters to customers in the education field. The host may provide a way for students to submit documents as part of an assignment. With the Office Online workflow features, hosts can configure Office Online to display a Submit button directly in the Office Online UI that, when activated, will display host-specific UI allowing the student to submit the document.

Supporting workflows in Office Online

In Office Online, documents participating in workflows display a button that takes the place of the Share button. The button’s text is specific to the WorkflowType.

WorkflowType Office Online workflow button text
Assign Manage Assignment
Submit Turn In

Important

In Office Online, the Assign and Submit workflow types are mutually exclusive. Only one of the two workflow types should be set for a given document session.

Much like Share, when clicked, the workflow button can either navigate to a URL in a new browser tab/window or send a message to the host frame.

To navigate to a URL, set the WorkflowUrl property to the URL that Office Online should navigate to.

To post a message to the host frame instead, set the WorkflowPostMessage property to true. When clicked, Office Online will send the UI_Workflow message to the host frame. The message includes the type of workflow that the document is participating in.

Tip

Office Online will always save the latest copy of the document to the host when the workflow UI is activated. This ensures that the host always has the latest copy of the document in order to use it in the workflow.

Important considerations

WOPI clients, including Office Online, do not understand what the workflow is and how it behaves. In other words, when you use the WorkflowUrl or WorkflowPostMessage properties, Office Online will display the workflow button and behave appropriately when triggered. However, if, for example, you wish to prevent a user from submitting the same document multiple times, you must handle that in your own UI. In other words, Office Online and other WOPI clients do not know anything about the workflow process except that the document is participating in a workflow so that the appropriate UI can be displayed. This provides the WOPI host great flexibility in their workflows, but the host is also responsible for managing the workflow as a whole.