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.