When I load a number of workflows into a new host it seems that a number of new instances after the first won't execute.

If I load an instance into a new host, and let it sit for a few seconds I can't reproduce this problem.

If I create the host, and let it sit for a few seconds before inserting I can reproduce this problem.

The host is listed as thread safe on the class in the msdn documentation.

From :

It notes that :

Workflow activation cost

Workflow activation happens when a workflow host calls the WorkflowRuntime.CreateWorkflow method. The first time this method is called for a workflow type, an activity tree is created and the workflow's activities are validated. On the second execution, the activity tree is already in-memory and the workflow has been validated, so the performance cost of calling this method is significantly reduced and the workflow runtime only has to create activity objects in the graph to be ready for the execution.

It follows that workflow activation time increases with the number of activities in the workflow. The complexity of an activity explained in the previous section also affects workflow activation time.

This seems to be the problem that IĄ¯m having but it doesnĄ¯t mention that creating more workflows during this creation will cause those workflows not to start.

Has anyone encountered this problem

Re: Windows Workflow Foundation some workflows not executing.


seems that under load the work flows get unloaded, and i wasn't checking those.

Re: Windows Workflow Foundation some workflows not executing.


Workflows will get unloaded if they are idle.(If they are waiting for an event or waiting for delay to expire) and you are using sqlpersistenceservice with unloadonidle = true. I hope your workflows are getting unloaded due to this reason