Back to: Configure and customize Microsoft Dynamics CRM
Table of Contents
Overview
Workflows, a type of Process in Microsoft Dynamics CRM 2011, are described by The Microsoft Dynamics CRM 2011 SDK as:
A business process can be of two types: automated processes that rely solely on communication among applications based on a set of rules, and interactive processes that also rely on people to initiate and run the process, and to make the appropriate decisions during the running of the process.
Think of automated processes like "triggers" that can create and update records, send out notifications by way of email or task, or call child workflows. On Demand workflows can be thought of as "macros", or more accurately as automated processes that are initiated through an initial user interaction. Fully interactive processes are called Dialogs and are not discussed in this article.
See The Microsoft Dynamics CRM 2011 SDK for more information.
Creating a New Workflow Process
In order to manage Workflows navigate to Settings -> Processes. This presents a list of existing Workflows and Dialogs that you can work with as well as the option to create new records. When creating a new workflow you will need to assign a name by which to reference it, choose the entity type that it will be associated with, and then select Workflow as the Category. Additionally you can choose to create a New blank process or a New process from an existing template.
After beginning a new workflow you will be presented with a number of options before adding any steps to provide automation. The Activate As option gives you the choice of creating a stand-alone workflow when you select Process. Selecting Process template allows you to save the record as a template which can later be re-used to save time when creating future workflows. The selections under Available to Run are As an on-demand process which allows the workflow to be run manually or As a child process which allows the workflow to be run from within another workflow. Both options can be selected if they meet your requirements. Under Options for Automatic Processes, the Scope allows you to determine which records can be affected by the workflow. The choice here operates in conjunction with the user’s normal security permissions and allows another method by which to filter records that can be affected. Lastly the Start when options determine what events causes the workflow to start running.
- Record is created – runs after a new record has been saved
- Record status changes – runs after a record is Activated or Deactivated
- Record is assigned – runs after the record has been assigned to another entity
- Record fields change – runs after the value of one of the selected fields changes
- Record is deleted – runs after the record is deleted
Adding Steps to the Workflow
Making selections from the Add Step menu are what allow you to add the actual automation to your workflow.
- Stage – allows steps to be separated into logical groups that correspond to phases in a pre-defined sales process – can be used in conjunction with the Sales Pipeline Report – once a Stage is added, all steps in the workflow must be contained in a Stage
- Check Condition - allows one or more conditions to be evaluated to determine if child steps to the Check Condition should be executed – multiple conditions are created using an AND operator – functions like IF logic
- Conditional Branch – used in conjunction to a Check Condition to provide an alternate path if the original condition evaluates to FALSE – this will only be available as a selectable option if a Check Condition is currently selected – functions like ELSE IF logic
- Default Action – also used in conjunction to a Check Condition to allow a fallback set up child steps to be executes if the original Check Condition and any Conditional Branches evaluate to FALSE – this will only be available as a selectable option if a Check Condition or Conditional Branch is currently selected – functions like ELSE logic
- Wait Condition –one or more conditions can be created and will be periodically evaluated to determine when the child steps to the Wait Condition should be executed – multiple conditions are created using an AND operator
- Parallel Wait Branch – used in conjunction to a Wait Condition – it provides an alternate set of conditions that will also be periodically evaluated to determine when the child steps to the Parallel Wait Branch should be executed – this will only be available as a selectable option if a Wait Condition is currently selected – multiple conditions are created using an AND operator
- Create Record – allows the workflow to create a new record for the specified entity and set initial values - values can be based on related records or can be manually entered
- Update Record – defines a set of updates to the current record the workflow is being processed against - values can be based on related records or can be manually entered
- Assign Record – changes the ownership of a record to a different User or Team – values can be based on related records or can be manually entered
- Send E-mail – creates and sends a new E-mail record – values can be based on related records or can be manually entered
- Start Child Workflow – allows another Workflow which has been defined as a Child Process to begin execution
- Change Status – allows Status of the current or a related record to be updated
- Stop Workflow – terminates any further processing of the workflow
Changing the Insert menu from After Step to Before Step dictates if a new step will be placed before or after the currently selected step.
Using Delete this step will remove the current step and all child steps from the workflow.
Administration and Notes
On the Administration tab you will you be able to change the Owner of the workflow to another User. There is a message indicating that when a workflow is reassigned that it must be activated before it can be used again. From this tab, in order to change the Owner the record must already be deactivated, however from the main record grid Workflows and Dialogs can be reassigned while they are still active – requiring them to be reactivated. A large Description field is also present to document any additional information regarding the workflow. Under Workflow Job Retention there is a single option, Automatically delete completed workflow jobs (to save disk space). When this is selected, a workflow job that completes successfully will immediately be removed from the workflow logs to reduce the amount of records stored. In an environment like CRM Online this option can help reduce the database size so you are less likely to hit your storage quota. When working with particularly complex workflows, this option should be disabled during testing and in the event you may suspect the workflow is not functioning correctly so you can have the benefit of reviewing the available logs. A standard Notes tab is also available to include additional time stamped detail that can include file attachments.
Auditing can be enabled for Workflows and Dialogs under the Process entity but details regarding the Steps are omitted. Only the header information and status changes are recorded.
Activating the Workflow
Once all steps have been added and changes have been saved you will see the workflow in a Draft Status. In order for the workflow to begin working, you must select a record and use the Activate button. A workflow can only be activated if all steps have been completed. An example of an incomplete step would be adding a Create Record step but not defining the entity type and setting any required fields. If successful, the workflow will now be in an Activated Status. At which point changes to the workflow will not be allowed until the selected workflow is deactivated using the Deactivate button.