User Defined Action - 401 Unauthorized

  • 25 April 2017
  • 6 replies
  • 20 views

Badge +3

So I created a Workflow to Launch the Workflow so the initiator would be the Admin. It did start with the Admin as the initiator, but workflow still failed. My colleague and I are both logging into Sharepoint with the same User Account (Test Account). When I enter an item the workflow runs fine. When he does the same it fails with these errors:

  • Failed to invoke web service. Error returned from server: The remote server returned an error: (401) Unauthorized.
  • Failed to run User Defined Action. The remote server returned an error: (401) Unauthorized.

Would it have anything to do with having two WFEs? Maybe he is hitting one and I'm hitting the other? I can't think of any other reason why it would work for me and not him since we are using the same account. It seems to work fine for him if he manually starts the workflow though which is why I assumed it was actually permissions the first time.

ETA - It runs two UDAs before this one fine with no issues so I don't think it is having trouble finding the UDAs or anything.

--------------------------------------------------------------------------------------------------------------------------------------------------------------

Original Post:

I have a User Defined Action which writes to a list that most users don't have access to. The workflows are published with an Admin account and the UDA is inside of an Action Set that is marked "Run As Workflow Owner". 

The workflow looks and runs fine as long as I run it with the Admin account, however when run from an End User Account the UDA fails with the errors:

  • Failed to invoke web service. Error returned from server: The remote server returned an error: (401) Unauthorized.
  • Failed to run User Defined Action. The remote server returned an error: (401) Unauthorized.

Am I missing something or can UDAs not be run with impersonation? It would be a shame to have to take these functions out of the UDA because then I'd have to modify them 14 times if they ever changed since the process is in 14 different workflows.

ETA: If the workflow is started manually the initiator becomes the Admin who started the workflow and it works fine. It is only when it starts automatically "Start when items are created" that the error occurs. However I have no option to always start it as admin, by default it will start as the user creating the item.


6 replies

Badge +8

Hi tast‌,

You say:  If the workflow is started manually the initiator becomes the Admin who started the workflow and it works fine.

Do you mean: ...the Admin who published the workflow...?

Cheers,

Rick

Badge +3

Yes - The Admin account creates and publishes workflows. 

Badge +8

Hi there,

I was just wondering if you made any progress on this issue?

Cheers,

Rick

Badge +3

I did finally figure out a resolution for this, although it is an odd workaround. We created an alternate access mapping for the site using the CA Server name as opposed to the existing alias names and now it works perfectly. No where am I specifying a URL or anything so it's odd that it did the trick but I won't question working happy.png

Badge

Hi,

 

Could you help me please in this issue because this error happened occasionally when I make workflow

 

Thanks very much

Badge
Please help me

Reply