I have 3 On-Create SharePoint Designer Workflows which I'd like to run (automatically) when creating items by code, using a WCF service.
At first, no workflows where created at all (the status column was empty). I've changed my WCF Service IIS application pool user not to be the System Account, which solved that problem.
Next, all workflows started in invalid state (Failed on Start). I've finally found a relevant post (Sharepoint workflow created from sharepoint designer failed on start when list item added from asp.net code via object model), which suggested I need to copy the
<System.Workflow.ComponentModel.WorkflowCompiler> section in my WCF's web.config file.
Both these actions seemed so solve most of the problems, but, sometimes, few of the workflows still start in "Failed on Start" status and don't run. It's very hard to specify. I have 3 workflows which should start on-create.
- When I start a new test (after an iisreset or a recycle), very few of the workflows are "Failed on start" (about 3, sometimes it seems as one per workflow column), on one of the first items (I don't create too many, even one item or 3 item)
- After that, all newly created items work as expected. (I've tested as many as 30 items, all work well)
- It's possible the environment in configured incorrectly, but it happens on two machines (dev and test), so it is less likely, but possible.
I know it doesn't sound like a proper question, but I hope someone have done something similar and can shed some light on the subject.