Lock Workflow

Last modified: April 18, 2024

1 Introduction

The Lock workflow activity can be used to lock a workflow.

This microflow activity allows developers to build a function for the workflow administration that stops the workflow execution. The Lock workflow activity can be used when the workflow definition contains errors and you have to prevent further damage to the process execution or data that will be difficult to undo/revert.

The information whether the workflow is locked is stored in the IsLocked attribute of the WorkflowDefinition entity. For more information, see the Definition-Related Entities section in Workflow Engine.

For information on unlocking the workflow, see the Unlock Workflow.

2 Properties

An example of Lock workflow properties is represented in the image below:

There are two sets of properties for this activity, those in the dialog box on the left, and those in the properties pane on the right.

The Lock workflow properties pane consists of the following sections:

3 Action Section

The Action section of the properties pane shows the action associated with this activity.

You can open a dialog box to configure this action by clicking the ellipsis () next to the action.

You can also open the dialog box by double-clicking the activity, or right-clicking the activity and selecting Properties.

3.1 Input Type

This option allows you to choose between a workflow document (the one that you usually select in the App Explorer of your app) and a workflow object provided by the Runtime) to target the workflow you want to lock.

3.2 Workflow

The workflow that is locked by this activity.

3.3 Pause Instances

With this option, all existing instances of the selected workflow which are in Incompatible or In-Progress state are paused. We do not pause the Aborted and Completed workflow instances because those are final states and there is no way to revert those instances. It is not possible to pause Failed workflow instances, because even if you unpause them by unlocking the workflow, they would not start to run automatically and you would lose data on the reason of a failure.

This option is enabled by default.

3.3.1 Workflow State Transitions Upon Lock And Unlock

In the table below you can see all workflow state transitions upon lock and unlock the workflow.

State State After Pausing Instances Upon Lock State After Reverting Instances Upon Unlock
InProgress Paused InProgress
Incompatible Paused Incompatible
Paused Paused Paused
Failed Failed Failed
Aborted Aborted Aborted
Completed Completed Completed

4 Common Section

For more information on properties in this section, see Common Properties.