1

Simply put, what is the difference between a "workflow subscription" and a "workflow association".

Here the two terms are used interchangeably.

I have created a workflow named MyWorkflow. When I associated it with my list I named the (what I used to call) association "MyWorkflow_officesupplyList" (...Im using sp online/csom btw)

3

Well, the story starts even before the WF subscription and association comes into picture. When we use CSOM, it is important to understand that how a workflow is invoked programmatically. There exist a Workflow service Manager which is responsible for getting all workflows for a site. In MSDN words, "This Describes the workflow host configuration states and provides service objects to interact with workflow instances."

Now lets talk about WF Subscription service and WF association.In simple words:

Workflow subscription service: It's one instance manages All workflow associations.

Workflow Association: It simply describes the association of a WF to a particular SharePoint component (e.g association with List or Site)

Needless to say that you will require WF subscription to get association. Please refer the sample code:

var workflowServicesManager = new WorkflowServicesManager(ctx, ctx.Web);            
var workflowSubscriptionService = workflowServicesManager.GetWorkflowSubscriptionService();              
var workflowAssociations = workflowSubscriptionService.EnumerateSubscriptionsByDefinition("guid-of-workflow");
ctx.Load(workflowAssociations);
ctx.ExecuteQuery();

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.