I have an issue with a SP2010 state machine workflow. The workflow contains two activities, in each of them I'm trying to send mails using the "SendMail" component.

I receive instead the following error:

System.InvalidOperationException: Correlation value has not been initialized on declaration X for activity Y.

There is definitely a problem with the correlation tokens that I can't figure out. From what I understand I must somehow use the same correlation token for both "SendMail" tasks even if they are in different activities.

Is that correct? The same correlation token must be used for both? Where do I get that from? I've tried to create the same token with the workflow as the "OwnerActivityName", tried different combinations, nothing...

I don't really get how I must set them up. Can someone guide me on this?

1 Answer 1


I managed to make it work by doing the following:

  • on the "onWorkflowActivated" component I've set up a correlation token with value "WorkflowToken" (name can be whatever you want) and for the owner activity name I've set the workflow itself.
  • for each "SendMail" component I used the same values: "WorkflowToken" for the correlation token and the workflow itself as the owner activity name.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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