Correlation tokens in Windows Workflow Foundation (WF)

You can consider a correlation token as a unique identifier that enables mapping between the objects in a workflow and the environment hosting the Windows Workflow Foundation (WF) workflow runtime.
Windows Workflow Foundation must provide some way for a workflow to communicate with other software. The Windows Workflow Foundation runtime acts as an intermediary for all communication with all workflows. When an incoming request arrives, the runtime receives it and then determines which workflow instance this request is destined for. The runtime then delivers the request to the target instance. In effect, the Windows Workflow Foundation acts as a proxy for all communication with software outside of the workflow.
You will have a separate correlation token for the each of the following:
The workflow itself
Each task you need to reference in the workflow
Important Note: 
Do not assign your workflow task the same correlation token as the workflow itself.
Declare the correlation token for the workflow in the OnWorkflowActivated activity. Then, for each activity that affects the entire workflow, bind that activity’s correlation token to the correlation token of the OnWorkflowActivated activity.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s