Settings
The Settings tab allows you to configure and manage Instance Threshold Policies on all workflows in your environment. Instance Threshold Policies help prevent looping and recursive workflows from entering a loop state and causing server performance degradation.
The Instance Threshold Policy contains two options, Workflow Instances and Step Instances.
- The Workflow Instances option allows you to configure a policy setting that, if a certain amount of workflow instances are started within a certain amount of time (in minutes), then any new instances are put into error state.
- The Step Instances option allows you to configure a policy setting that, if a certain amount of steps are executed within a workflow instance within a certain amount of time (in minutes), then that workflow instance is put into error state.
Permissions
To configure Instance Threshold Policies at workflow server level, you need to be a K2 Administrator.
Follow the steps below to configure a Instance Threshold Policy.
- Open K2 Management and click the Workflows node.
- On the Workflows node, click the Settings tab.
- Configure the Workflow Instances and Step Instances options.By default, the Workflow Instancesoption is set to 10 instances that occur within 1 minute and the Step Instances policy is set to a default of 1000 steps within 60 minutes.
- Note that changes you make to these options are automatically saved.
- For the purpose of this example, the Workflow Instances option is set to 4 instances in 1 minute.
- When any workflow on the server exceeds this policy, new instances are placed in to error state . The Leave Request Workflow exceeded the Workflow Instances option of the policy and the instance that exceeded the policy went in to error state. The first four instances executed successfully but the fifth instance went into error state as per the policy.
- To view a detailed description of the error, you can view it in the Errors > All node or in the Errors tab on the Process Details page of the workflow. The following error is displayed:
Workflow process instance threshold exceeded. Too many workflow instances were started based on your policy. - If a Step Instance option of a policy is exceeded, you can view the error in the Errors > All node or in the Errors tab on the Process Details page of the workflow. The following error is displayed:
Workflow step instance threshold exceeded. Too many workflow steps were started based on your policy.
- Instance threshold policies do not check your workflow logic for exit conditions. If you have configured loop steps intentionally in your workflow that will violate a policy at runtime, the workflow instance is forced into an error state.
- After enabling an instance threshold policy, any existing workflows instances continue to run. Any new workflow instances that get started which exceed the default policy settings are forced into an state.
- In scenarios where you have multiple, load-balanced servers, instance threshold policies are shared with all servers in the farm. However, the policies are enforced per server.
- In a scenario where Call Sub Workflow (IPC) steps start new instances on multiple servers, the steps start new instances until the threshold is reached on server one. Any new instances that get started on server one go into error state. Any new instances that start on server two (which has not exceeded the threshold policy setting) are processed until server two's threshold policy is exceeded.
- If the Settings tab is not visible on the Process Details page, see KB002789 for more information.