Disable kenaflow or a workflow

This chapter is about the different ways to disable the kenaflow engine at all and/or just a single workflow.

Disable kenaflow

Disabling the whole kenaflow engine can be achieved in three ways:

  1. Disable the Windows scheduled task.
  2. Execute kenaflow.exe --disable [<timespan>].
  3. Create a ".disabled" file in the program folder.

Disable the Windows scheduled task.

To disable kenaflow by disabling the scheduled task you just need to open the "Windows Task Scheduler" from the start menu or execute taskschd.msc. If you installed the kenaflow scheduled task using kenaflow.exe with program switch --installschedtask than you find a scheduled task in the list with kenaflow as start of the name followed by the instance id. Just right click the task and select "Disable" from the context menu. - To re-enable the workflow just click "Enable" in the context menu.

Execute kenaflow.exe --disable [<timespan>]

This program mode can be used to disable the kenaflow engine at all.

This command creates a file named .disabled in the kenaflow program folder.

If a <timespan> was specified the file contains the date and time until kenaflow is disabled. Format of the string is: yyyy-MM-dd-HH-mm-ss. Just 1 line. No characters before or after the datetime string.

If no <timespan> was specified the file will be empty with exactly 0 by length. In this case the disabled state lasts forever.

To re-enable the enigne there is a program mode called --enable.

See:

Create a ".disabled" file in the program folder

You can create the .disabled file manually iun the program folder, for example before patching the system or third party systems that are connected with kenaflow. For example before patching SharePoint you should stop kenaflow and the easiest way is to create the .disabled file.

To re-enable kenaflow just delete the .diabled file.

Disable a workflow

Sometimes it is required to disable a workflow.

For example when developing a workflow in an IDE you don't want it to run automatically. In this case you need to disable it. But there could be other scenarios where you want to disable a workflow. For example if it throws lots of errors and sends to much error mails. Then you want to stop it from running....

There are three ways:

  1. Disable the workflow in the file _wfconfig.ps1.
  2. Disable it with program switch --disableworkflow [<timespan>]
  3. Disable it by creating a .disabled file in the workflow folder.

Disable the workflow in the file _wfconfig.ps1.

Each workflow has a setting Enabled in it's configuration file _wfconfig.ps1. When you set the setting to$false the workflow engine will recognize the change of the file and all processes that work with this workflow get informed. All read the new workflow config. And because the workflow is now disabled they will not process the workflow or, for example, any remote events for this workflow that come along.

To re-enable the workflow just set Enabled to $true and save the workflow config file.

Disable it with program switch --disableworkflow [<timespan>]

Starting with kenaflow 4.0.24 it's possible to deactivate a workflow with command line switch --disableworkflow [<timespan>].

The "current directory" need to be the workflow folder OR you specify the workflow using --workflow <folder-path>.

If you do not specify a <timespan> the workflow is disabled forever.

If you specify a <timespan> the workflow if disabled for the specified amount of time starting from NOW.

In the first case (no <timespan>) an empty (zero byte) file names .disabled is created in the workflow folder. In the second case the same file is created but with the end-of-disable date and time as string as file content. Format: yyyy-MM-dd-HH-mm-ss.

To re-enable the workflow you can use program switch --enableworkflow.

See:

Disable it by creating a .disabled file in the workflow folder.

The third option is to create the .disabled file manually inside the workflow folder. This can be done manually or by some third party system or a custom script.

To re-enable the workflow you just need to remove the .disabled file. Most kenaflow processes will recognize the deleted file really soon but it could take up to 5 minutes before the workflow will run again. To minimize this time just set the "last written" timestamp of the file _wfconfig.ps1 to the current date/time. That's exactly what --enableworkflow does after removing .disabled.