Detecting a SharePoint Designer Workflow Association

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!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.