cancel
Showing results for 
Search instead for 
Did you mean: 
Workflow Hero

User Defined Action - 401 Unauthorized

Jump to solution

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.

Labels: (1)
0 Kudos
Reply
4 Replies
Workflow Hero

Re: User Defined Action - Run As Workflow Owner

Jump to solution

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

Reply
Workflow Hero

Re: User Defined Action - Run As Workflow Owner

Jump to solution

Yes - The Admin account creates and publishes workflows. 

Reply
Workflow Hero

Re: User Defined Action - 401 Unauthorized

Jump to solution

Hi there,

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

Cheers,

Rick

Reply
Workflow Hero

Re: User Defined Action - 401 Unauthorized

Jump to solution

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

0 Kudos
Reply