To use InvokeWorkflowActivity, see Using the InvokeWorkflowActivity Activity The only thing we need to do is assign a workflow type to the TargetWorkflow property of InvokeWorkflow activity.
Once we set the TargetWorkflow property, the Properties panel will be updated and the sub-workflow's dependence properties will show up in the Properties panel of InvokeWorkflowActivity.
We can set static values for these properties or bind each property to a property in the current workflow. Since the sub-workflow instance will executes on its own thread, you cannot retrieve sub-workflow output from its parents workflow.
InvokeWorkflowActivity also provide a invoking event handler for set sub workflow parameters in code. But I can not find any documents or blog articles talk about how to set parameters in the invoking event handler, So after some research and test, I wrote this code and it works:
private void invokeWorkflowActivity1_Invoking(object sender, EventArgs e) {
var parameterBindings = this.invokeWorkflowActivity1.ParameterBindings;
parameterBindings[0].Value = "value of parameter";
}
Hope this will be helpful to you.
PS: Question from MSDN forum:
InvokeworkFlow Activity in Windows WorkFlow Foundation
06aa3ac9-e952-4a6a-8603-727d9b6d5507|0|.0
WF3