Microsoft Dynamics CRM 2011 - Workflow Type (In SQL)

Ive been working a lot with CRM workflows recently, and had the notion of updating my documentation for my workflows. My thinking is, that as these are all SQL entries, I should be able to create an SSRS report that can easily update my documentation.

While browsing through the SQL tables, the view.Workfow has the column 'TYPE'. The purpose became much clearer when I noticed the multiple entries for each workflow.

This is a great explanation of the TYPE field, from Michael B. Scott on the Microsoft Forums -http://social.microsoft.com/Forums/en-US/b717ae4a-1e5d-48d2-880e-c961ff9a776d/crm-2011-workflows-being-duplicated?forum=crm

If you look at the schema for the Type attribute, there are three values:

1 = Definition
Definition of a Workflow that is displayed in the application in the “All Processes” view. When you make changes to a workflow, you are making a change to a Workflow definition (or template); if you delete a workflow, you are deleting a workflow definition (or template)
2 = Activation
Whenever you activate (or publish) a workflow, an Activation record is created. An activation represents a snapshot of the workflow definition taken at activation time. If a Workflow is triggered, the System Job (asyncoperation) links back to the Workflow Activation record. Imagine you activate a workflow, a workflow is triggered and is in the midst of running, when you deactivate the workflow and make a change. In order to not effect the currently running Workflow, it uses the Workflow Activation record. If the workflow is triggered again, it will use the new definition (or workflow activation).
3 = Template
If you mark a Workflow as a Workflow Template, it will show up on the new Workflow dialog. If you choose to use a template, a copy of the template will be used as a basis of the Workflow.
When a Workflow is deleted from the system, the definition is deleted. However, if the workflow was ever published the Activation will remain for a period of time. Once all of the System Jobs that reference a particular Workflow Activation have completed and have been cleaned up (occurs through a recurring daily bulk delete job), the Workflow Activation will also be deleted.

Hope that makes things a little clearer. Otherwise, please feel free to ask some another question.
— Michael B. Scott - MSFTMicrosoft (MSFT)