Monday, November 1, 2010

SharePoint 2010 Impersonate Workflow

Ive been getting some workflow problems lately in that when a user adds an item thats supposed to kick off a workflow, the workflow fails before start or while its in progress with "access denied" or "unauthorised access".

At first i couldnt understand this because MSDN documentation clearly states that workflow by default executes as system account / administrator.

I found out that the problem had to do with the fact that these users who were getting these problems were in a permissions group that prevented editing. For some reason, this permission is required to KICK OFF a workflow.

So the solution is to impersonate your workflow. In sharepoint designer 2010 click on the "Impersonation Step" icon which sits next to the "Step" icon in the workflow tab. This inserts an impersonation step. Every action you put into this step will be impersonated as the author of the workflow. So you just have to make sure that the author (you) has edit permissions on the list.

Make sure you move all the actions and condition blocks into your impersonation step and delete the old normal step. Then save and publish.

p.s. you can move the actions and condition blocks by clicking on the "Move Up" or "Move Down" links in the Workflow toolbar.

No comments:

Post a Comment