2013-07-04

A few weeks ago I was totally vexed with a problem with a workflow on one of my SharePoint document libraries that didn’t work as I expected. I set it to start on document creation and the workflow needs the metadata of the document to do it’s thing. When I added a document and set the metadata, the workflow would start up alright but it would stay in the starting state and never progress from there.

After some trial and error I figured out why: a document already gets created in a SharePoint document library after you click OK to upload it and before you set the metadata. When you set and save the metadata in the second step of the upload, that’s considered a change to the document. So if your workflow needs that metadata and you start it on document creation, it will not work. Instead, you have to kick it of on document change.
As a side note: if the workflow needs certain metadata that is not mandatory, you should put a condition on your workflow that the needed field should be populated.

I hope this saves other people the headache it gave me!

About the author 

Eduard Spelier