Lock Workflow

Last modified: August 20, 2024

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.

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:

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.

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.

Workflow

The workflow that is locked by this activity.

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.

Workflow State Transitions Upon Lock And Unlock

The table below shows all workflow state transitions upon lock and unlock the workflow.

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

Common Section

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