Attach workflow to content type in SharePoint 2010

This SharePoint workflow tutorial explains, how we can attach a workflow to a content type in SharePoint 2010.

A SharePoint workflow can be attached to a list, site or to a content type in SharePoint 2010. But there are only two options in the workflow wizard: list or site workflow. So how do you associate the workflow with a content type? In order to associate the workflow with a content type, you have to change the AssociationCategories element value in the workflow’s Elements.xml file to ContentType.

For this Double-click the Elements.xml file for the workflow to open it.

Locate the AssociationCategories element and change its value to ContentType like:


Click on the Workflow1 project item folder and open the Properties window. And change the value of the Auto Associate property from True to False.

Then press F5 to build, package and deploy the project.

Then go to the Site Actions ->Site Settings and under document content types click the Document content type.

You may like following SharePoint workflow tutorials:

Now click the workflow settings link, the Workflow settings page is displayed. Click the Add a workflow link, the add a workflow page will be displayed and from there you can select the workflow for the content type.

Donwload Hub site pdf

Download SharePoint Online Tutorial PDF FREE!

Get update on Webinars, video tutorials, training courses etc.