Conditional Start Rule
In Workflow Designer, you use the Start step to configure how your workflow starts. You can select to start the workflow with a form, a SharePoint event, or from Management. By default, workflows always start when triggered by these methods.
Sometimes you don't want a workflow to start unless it meets certain conditions. In these cases, you use a Conditional Start Rule which allows you to add conditions in a rule to either start or not start the workflow. The Conditional Start Rule evaluates data outside of the workflow and, based on the outcome, either starts the workflow or not.
Keep in mind that the Conditional Start Rule is not a Decision step. This rule cannot determine which path to follow within a workflow or who gets a Task. It only evaluates the condition you set and starts the workflow if the condition is met.
If your Conditional Start Rule is met (condition = true) the workflow starts. If the condition is not met (condition = false) the workflow does not start.
If you start a workflow from a SmartForm and the start condition is not met, a message is shown and nothing further happens. You can find an entry in the server logs stating “The process <name> was not started because the conditional start rule evaluated to false” to show that the workflow instance did not start. To find the server log go to <install drive>:\Program Files\K2\Host Server.
Here are some examples where you might want to use a conditional start rule:
- If employees have five or more leave days available to them, start the workflow.
- If the requested start date falls within the last two weeks of December, don't start the workflow. See the How To: Use SmartForm references to determine the outcome of a workflow Conditional Start Rule.
- If a client's account is past due, don't start the workflow.
- If the travel claim is more than $2000, start the workflow.
- If someone adds a document with a specific document name to a SharePoint Library, start the workflow. See the How To: Use SharePoint Library references to determine the outcome of a workflow Conditional Start Rule.
- If a custom field status on a list item changes from In Progress to Ready for Review, start the workflow.
See the following resources for more information:
- See How To: Use a SharePoint References to Conditionally Start a Workflow for an example of using a SharePoint library reference to configure a rule which determines if a workflow should start.
- See How To: Use a SmartForm Reference to Conditionally Start a Workflow for an example of using a SmartForm reference to configure a rule which determines if a workflow should start.
Example
An example use of the Conditional Start Rule is that you use SharePoint document libraries to store team documents. You have two libraries called General Documents and Purchase Orders. These two libraries are not integrated with SharePoint. Purchase orders are supposed to be stored in the Purchase Orders library where Finance keeps them. All other documents are stored in the General Documents library. Sometimes documents end up in the wrong place, with purchase orders stored in the General Document library. In these cases, someone should be notified that documents are in the wrong library.
For this scenario, you want a workflow to start when Purchase Orders are added to the General Documents library. You are not concerned about the other types of documents, just Purchase Orders. The workflow only starts if the condition, set in the rule, is met. In this case, the workflow starts if the Name field contains the words “Purchase Order”.
To configure the rule, select the Conditional Start option in the Start step. You can use information from SmartObjects, references, and variables to configure the rule. You create an IF-THEN-ELSE rule using the Rules Designer.
From the Context Browser, drag Fields, Functions, SmartObject, or Workflow-related properties to customize the conditional start rule.
Example of a Conditional Start Rule