LoadAndInvokeWorkflow Activity

Loads an activity from XAML and invokes it.
Namespace: Microsoft.Activities.Statements
Assembly: Microsoft.Activities (in Microsoft.Activities.dll)


Input InArgument<IDictionary<string, object>> The Dictionary of input arguments to send to the workflow
LocalAssembly InArgument<Assembly> Sets the current local assembly for processing XAML
Path InArgument<string> Path to the XAML file
Timeout InArgument<TimeSpan> Timeout passed to WorkflowInvoker - the workflow must complete within the timeout


TimeoutException The activity did not complete within the timeout


The activity simply calls LoadActivity followed by InvokeWorkflow. If you are going to invoke the workflow more than once you should use LoadActivity to load it once and then call InvokeWorkflow as many times as necessary.

Last edited Sep 22, 2011 at 12:36 AM by ronjacobs, version 2


JohnAskew Apr 3, 2012 at 9:31 PM 
So little response merits more comments.
I'm using LoadAndInvokeWorkflow with a calculated workflow xaml file name.
This results in a NullReferenceException since the physical file cannot be verified.
Surely I'm not the only one who's got a lookup-driven database respository of xaml files to copy to disk and load and run... So this validation needs to either be a warning or have a flag to turn off, no?

JohnAskew Jan 20, 2012 at 4:01 PM 
(I think both are yes... I know the first is yes.)

JohnAskew Jan 18, 2012 at 6:15 PM 
Can this be used with a workflow hosted through a WorkflowServiceHost and/or a WorkflowServiceHostFactory?
Must loadable child workflows be in a different assembly than the calling workflow?