Detecting a SharePoint Designer Workflow Association

April 03, 2009

In a recent project, I had to find out which of the workflows in the site collection were made with SharePoint Designer. I did a recursive code that checked in all SPList instances in every SPWeb for the following combination:

  • For each SPList.WorkflowAssociations

  • SPWorkflowAssociation.BaseTemplate == null

  • SPWorkflowAssociation.InternalName.Contains(“Xoml”)

I also checked to see if the workflow association was active (SPWorkflowAssociation.Enabled == true) because the previous versions of the SPD workflows are also stored as associations, but they are disabled.

I hope this little snippet can help you in similar cases. Have a nice coding!

Profile picture

Written by Edin Kapić Insatiably curious code-writing tinkerer. Geek father. Aviation enthusiast. Cuisine journeyman. Follow me on Twitter