Workflow and process entities

 

Applies To: Dynamics CRM 2013

The Microsoft Dynamics CRM workflow object model is a set of classes that uses the Windows Workflow Foundation object model and exposes Microsoft Dynamics CRM workflow activities. These classes are found in the Microsoft.Xrm.Sdk.Workflow assembly. For more information, see Microsoft.Xrm.Sdk.Workflow.

Workflow activities are the elemental units of a workflow (process). They are added to a workflow (process) to form a hierarchical tree structure. When all activities in a given path are finished running, the workflow (process) instance is completed.

The workflow entity stores the definition of a workflow (process). This definition contains the XAML string that describes the workflow activity, and also the rules used in the process.

The validity of a workflow definition may depend on external data. There are several types of dependencies that are supported:

  • SDK operation: If a process is triggered on a specific SDK operation, it cannot be deleted.

  • Input entity: A process depends on a snapshot of a record passed in to the workflow.

  • Local parameter: A formal description of a .NET property to be defined by the process type.

The workflow log entity contains detailed information about logical steps completed during the execution of a workflow. Similarly, the process session entity contains information about the running of a dialog.

If a workflow was created in the web application and the workflow definition has the Workflow.AsyncAutoDelete attribute set to true, and the workflow has a single step in it that is not a Stage/Wait/Condition step, no WorkflowLog records will be created. This is an platform optimization to improve performance and save disk space.

There are two messages you can use to work with processes. SetStateRequest is used to set the state of the process: draft or activated. CreateWorkflowFromTemplateRequest is used to create a process from a process template.

See Also

Supported types, triggers, and entities for processes
Write workflows to automate business processes
Workflow (process) entity messages and methods
WorkflowLog (process log) entity messages and methods
ProcessSession entity messages and methods