[Applies to: Microsoft Dynamics CRM 4.0]
Workflow customizations
Part 8 of "11 things to know about customization"
The goal of customizing Microsoft Dynamics CRM is to tailor the application to fit your business. Although workflows are not located in the area where other customizations are applied, they represent a way to perform automation that would otherwise require a significant amount of development work. Always consider whether a customization objective can be achieved by using workflow when evaluating your options.
Workflows are sets of logical rules that define the steps necessary to automate specific business processes, tasks, or sets of actions to be performed on Microsoft Dynamics CRM records.
You can automate business processes by creating workflows and applying them to records or allowing Microsoft Dynamics CRM to apply them automatically. By using workflows to automate your business processes, you can:
- Ensure consistency in how records are handled.
- Ensure consistency in the information that is stored in your organization's Microsoft Dynamics CRM database.
- Allow people in your organization to focus on growing your business instead of performing repetitive tasks.
If you have the System Administrator or System Customizer security role, you have the necessary permissions to create workflows that can affect records throughout your organization's implementation of Microsoft Dynamics CRM. However, even if you do not have one of these security roles, you can still create workflows that affect the records that you own.
Workflow structure
All workflows in Microsoft Dynamics CRM are a combination of workflow properties and workflow logic. Workflow properties and workflow logic form the structure of each workflow record.
Workflow properties
Workflows include a number of options and settings that are required as part of any workflow in Microsoft Dynamics CRM.
At a minimum, each workflow requires the following properties:
- Name: A descriptive name makes it easier to find the right workflow.
- Entity: Although a workflow can take action on more than one entity, it is still associated with a single primary entity.
- Scope: A workflow's scope determines the records that the workflow can take action on. The scope is limited by the permissions that the workflow's owner has, as well as by the access level the owner selects for the scope when they are creating the workflow.
Scope options are:
- Organization
- Parent:Child Business Units
- Business Unit
- User
- Type: You can select whether the workflow you create is a workflow or workflow template. A workflow template is a type of workflow that serves exclusively as the basis for creating other workflows. Workflow templates cannot start workflow jobs.
- How automatic workflows are started: You can specify what events in your Microsoft Dynamics CRM implementation will cause the workflow to take action, such as the creation of a new lead record or a specific change to a case record.
Available events are:
- When a record is created.
- When the status of a record changes, such as when it is closed or deactivated.
- When a record is assigned to someone else.
- When a specified field in the record changes.
- When a record is deleted.
- Availability: In addition to workflows that run automatically when certain events occur, you make the workflow available as an on-demand workflow, a child workflow, or both:
- An on-demand workflow is a type of workflow that runs only when a user chooses to apply it to records from a toolbar or menu in Microsoft Dynamics CRM.
- A child workflow is a type of workflow that runs only when started by another workflow. It is contained within a parent workflow and cannot be run on its own.
Workflow logic
The workflow logic you add to your workflow determines the specific actions that the workflow will take on records.
Workflow logic includes the following elements:
- Stages:Workflow stages are elements of workflow logic that group steps. Workflow rules determine the required activities for a workflow and the order in which those activities must be performed. By adding workflow stages to your workflow logic, you can group the steps in your workflow. Workflow stages make the workflow logic easier to read, and explain the workflow logic. However, stages do not affect the logic or behavior of workflows.
A system job is a process that Microsoft Dynamics CRM performs independently or in the background. Workflow stage descriptions appear as headings in system job forms, which display the progress of a workflow job, a type of system job. Stage descriptions can also appear in reports.
You can use stages to define business processes that your organization uses. For example, one workflow could use stages to describe the opportunity management process for your sales team, while another workflow could define the case resolution process for your customer service representatives.
- Steps: A workflow step is an element of workflow logic that defines a unit of business logic within a workflow. Steps can include conditions, actions, other steps, or a combination of these elements. Each workflow step you add defines the underlying logic of your workflow. Workflow steps can contain actions, such as creating a new record or sending an e-mail notification, or even other steps. (There is no limit to how deeply you can nest workflow steps.)
You can add the following types of steps to workflows:
- Check Condition: Defines a specific situation and any actions that should be taken if that situation occurs. A logical "if-then" statement in a workflow.
- Conditional Branch: Defines an alternative condition and action or additional steps, in cases when the criteria in a check condition element are not met. A logical "else-if-then" statement in a workflow.
- Default Action: Defines an alternative action in all cases that do not match the criteria defined in check conditions or parallel wait branch elements. A logical "else" statement in a workflow.
- Wait Condition: Enables a workflow to pause itself until the criteria defined by the condition have been met. The workflow starts again automatically when the criteria in the wait condition have been met.
- Parallel Wait Branch: Defines an alternative wait condition with a corresponding set of additional steps that are performed only when the initial criterion is met. You can use parallel wait branches to create timeouts in your workflow logic. They help prevent the workflow from waiting indefinitely until the criteria defined in a wait condition have been met.
- Custom step: Provides extensions to the logical elements available by default in Microsoft Dynamics CRM. Steps can include conditions, actions, other steps, or a combination of these elements. Custom workflow steps can be developed by using the information in the Microsoft Dynamics CRM SDK.
- Actions: Actions are elements of workflow logic that specify the actions that should be performed by workflow jobs when conditions defined in the workflow have been met. By adding workflow actions to workflow steps, you define the specific actions you want the workflow to perform.
You can add the following actions to workflows:
- Create a record
- Update a record
- Assign a record
- Send an e-mail notification
- Start a child workflow
- Change the status of a record
- Stop the current workflow
- Perform a custom workflow action
Three ways to create workflows
There are three ways that you can add workflows to your implementation of Microsoft Dynamics CRM:
- Create workflows by using the Microsoft Dynamics CRM Web application. You can create workflows and workflow templates in the Settings area.
- Create custom workflows and custom workflow actions by using the information that is available in the Microsoft Dynamics CRM SDK.
- Purchase custom workflows or custom workflow actions from third-party vendors who develop solutions that are compatible with Microsoft Dynamics CRM.
Creating workflows by using the Web application
There are four basic steps to creating a workflow by using the Web application:
- Create an empty workflow or use a workflow template to create the workflow.
- Specify the workflow properties.
- Add conditions, workflow actions, and other elements that define your workflow logic.
- Publish the workflow.
For detailed step-by-step instructions to create workflows, see "Create or edit a workflow" in the Help topic, "Work with Workflows".
Related Links
Part 9: Client extension features