0
votes

I'm using the SharePoint Three-State workflow for a complete and then validate scenario on an InfoPath form. A web service creates the instance of the InfoPath form in the library. The idea is that the workflow will get a particular user to complete the form and then gets a manager to approve it. Simple stuff really.

The workflow fails to start unfortunately. The log shows an argument exception when it tries to start the workflow. Strangely it runs fine when manually started so that rules out the association data being incorrect. I've also tried this with other OOTB workflows such as Approval. I've thought it might also be the creation of the item through the web service but then it all works in my development environment.

I'm hoping someone might be able to contribute what I'm forgetting to check.

2

2 Answers

1
votes

What identity is your workflow attempting to start under? If it is the SharePoint System Account, that account cannot start declarative workflows, as documented in this SharePoint Designer Blog post on MSDN.

This same problem impacted one of our workflows, where a web part programmatically created a list item and our workflow was set to trigger on item create and update actions. Manually creating items or manually running the workflow worked because it happened under our personal credentials.

Our solution was to simply create a service account in AD that the web part could impersonate. Once the list items were no longer being created under the System Account, the workflow worked as expected.

0
votes

If you are receiving an argument error, I would check that the workflow is not referencing a field that would not be populated at the time of creating the list/library item. If you reference something like the ID field or a calculated column this field would not be available.