Link to home
Start Free TrialLog in
Avatar of I_play_with_DNA

asked on

Workflow Permissions

We have several workflows that get trapped in a waiting state when they are run.  When I pull a list of system jobs in a waiting state, the error on these jobs is:

"Workflow paused due to error: Unhandled Exception: System.Web.Services.Protocols.SoapException: Server was unable to process request.
Detail: <detail><error>
  <description>SecLib::CrmCheckPrivilege failed. Returned hr = -2147220960 on UserId: 66f60ce6-738a-dd11-9674-001ec9d6dbbe and PrivilegeId: 6fd3eb4f-66e3-4587-b4ab-c064f03ad783</description>
   at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
   at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
   at Microsoft.Crm.SdkTypeProxy.CrmService.Execute(Request Request)
   at Microsoft.Crm.Asynchronous.SdkTypeProxyCrmServiceWrapper.Execute(Object request)
   at Microsoft.Crm.Workflow.Services.SendEmailActivityService.Execute(ActivityExecutionContext executionContext, SendEmailActivity sendActivity)
   at Microsoft.Crm.Workflow.Activities.SendEmailActivity.Execute(ActivityExecutionContext executionContext)
   at System.Workflow.ComponentModel.ActivityExecutor`1.Execute(T activity, ActivityExecutionContext executionContext)
   at System.Workflow.ComponentModel.ActivityExecutor`1.Execute(Activity activity, ActivityExecutionContext executionContext)
   at System.Workflow.ComponentModel.ActivityExecutorOperation.Run(IWorkflowCoreRuntime workflowCoreRuntime)
   at System.Workflow.Runtime.Scheduler.Run()

From the 'description' tag in the error, it looks like the user running the workflow does not have sufficient permissions.  All this workflow does is check the setting of two fields in the Order entity, and if the check condition passes, an e-mail is generated and sent to someone in another department.

I have two questions regarding this:
1.  Which user's credentials are used when a workflow runs?  Is it the workflow owner, or the user triggering the workflow?
2.  How do a figure out exactly which permissions I need to give to make the workflows work?  They work if the workflow owner is given system administrator role but, of course, this is not acceptable.
Avatar of Jeff Wight
Jeff Wight
Flag of United States of America image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of I_play_with_DNA


Thanks.  I had previously looked up the user with the GUID in the error, but for some reason it didn't occur to me to do the same for the PrivilegeId.  Turns out it was the 'Send E-mail as Another User' permission.

Was I correct in thinking that the workflows run under the credentials (and therefore the permissions) of the workflow owner, and not the permissions of those triggering the workflow?
Ahh, yep.  Makes sense that it would be that permission.  Yes, I believe that is the case (workflow rule owner credentials are used).