Scheduled site workflow is giving Access Denied error for Query List action

  • 29 January 2016
  • 7 replies
  • 3 views

Badge +7

Hello Team,

I have a site workflow which will Query a list if any of items fallen on Today's date. And sending all items to the Team for review.

When I run the workflow manually the workflow is giving me the expected outcomes. It was scheduled to run at 9AM every day, but this scheduled run is giving us the following error: Failed to query list data. Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))

We have Nintex 2013 and SharePoint with SP1.

Any thoughts??

Thanks,

Soni


7 replies

Userlevel 4
Badge +11

Hi,

is the user who schedule the workflow allowed to see that list?

The workflow will run as the user who has created the schedule, so he needs to access the list (or, you have to execute the query list action as the workflow owner and publish the workflow with a user with enough permission on the list)

Giacomo

Badge +7

Hello Giacomo,

The user who published the workflow and the one who who scheduled the workflow both are Admins. And if the same person (who scheduled the workflow) runs it manually it is succeeding. To test I scheduled the workflow and it ran successfully. Only the previous person (who is also admin) has some problem in running the workflow. Any Thoughts?

Userlevel 4
Badge +8

Soni - When you say the users are admins, do you mean they are "site collection administrators" or "site owners"?  Is the list you are querying in the same site as the workflow?  The fact that the user who schedules it does not have a problem running it manually is interesting.  I don't have an answer for that.

But, Giacomo Gelosi​ suggested, you should put the query list action into an Action Set, and enable the "Run as Workflow Owner" setting on the Action Set.  Then it won't matter who schedules it.  It will always run as if you scheduled it, assuming you are the workflow owner.

Badge +7

Hello Tom,

We both are farm admins! And yes the list is in the same site where I'm scheduling.

One strange thing I observed is: I scheduled the workflow to run daily at 9AM, and I tested it on Friday around 1:30AM and the schedule was successful. So I changed the timing to 9AM, on Friday it went successful. But again on Saturday and Sunday I received workflow errored emails with Access Denied error. Now I'm totally confused?!!

But I will add the Action Set as you suggested and will test the scheduled run.

Thank You!

Userlevel 4
Badge +8

Note that being a farm admin doesn't grant permission to sharepoint content. Try making the the user a site owner or site collection administrator.

Tom Castiglia

858-610-8697

Sent from my iPhone

Badge +7

Thank You Tom, looks like it is working after adding me as Site Collection Administrator.

Badge +7

I'm trying to mark Tom's reply as Correct Answer. But I'm not seeing the Correct Answer option for my question?!!

Reply