We help IT Professionals succeed at work.
Get Started

Workflow Permissions

1,607 Views
Last Modified: 2013-11-24
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>
  <code>0x80040220</code>
  <description>SecLib::CrmCheckPrivilege failed. Returned hr = -2147220960 on UserId: 66f60ce6-738a-dd11-9674-001ec9d6dbbe and PrivilegeId: 6fd3eb4f-66e3-4587-b4ab-c064f03ad783</description>
  <type>Platform</type>
</error></detail>
   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.
Comment
Watch Question
Business Solutions Manager
Commented:
This problem has been solved!
Unlock 1 Answer and 4 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE