SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a workflow event receiver which is handling the WorkflowStarted and WorkflowCompleted events. I need to obtain references to the workflow list item and the workflow object to do some additional processing. How do I go about that?

share|improve this question
up vote 2 down vote accepted


You can have a look at this question on MSDN which will give you code reference to get the workflow association with Workflow Manager

And here is how you can get the item, history, tasks etc:

  public override void WorkflowStarted(SPWorkflowEventProperties properties)

       SPSite site = new SPSite("SPURL");
       SPWeb web = site.RootWeb;
       SPList list = web.Lists["ListName"];
       SPWorkflowCollection workflowCollection = new SPWorkflowCollection(list);
       SPListItem item = null;
       SPList task = null;
       SPList history = null;
       foreach (SPWorkflow workflow in workflowCollection)
           if (workflow.InstanceId == properties.InstanceId)
               item = list.GetItemById(workflow.ItemId);
               task = workflow.TaskList;
               history = workflow.HistoryList;

share|improve this answer
Thanks, this is just what I needed! – Mihai Oct 15 '12 at 14:36

You can use SPWorkflowEventProperties class object like

properties.ActivationProperties.Workflow to get the reference of workflow.

properties.ActivationProperties.List to get the reference of list. And

properties.ActivationProperties.Item to get the reference of Item.

share|improve this answer
Thanks. This looks like the right way to do it, and with much less code than the other answer. – Mihai Nov 8 '14 at 21:15

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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