Workflow error in SP2013 related to App Step

I had a situation when my workflows went to “Suspended” after a few minutes. I noticed this occured when I used the “App Step”. Looking at the “Suspended” state, there was an “i” icon, when clicked, showed this error:
Details: An unhandled exception occurred during the execution of the workflow instance. Exception details: System.ApplicationException: HTTP 401 {“error_description”:”The server was unable to process the request due to an internal error

Here is how the error actually consistently appears:
WF Suspended

It turns out the App Step will not work, without specific configuration to grant the App Step rights.

So of course some permission issue was most probable. And I was suspicious of App Step, as I mentioned yesterday as the proximate cause.

So configured the permission as below link:
https://www.dmcinfo.com/latest-thinking/blog/id/8661/create-site-from-template-using-sharepoint-2013-workflow

The description in the above link should make things really clear. So when an App Step runs, it uses permissions that needed to be set.

One more thing, we need specify the Scope URL as below

On the subweb, you will find the configuration setting for app permission: http :[SPWeb URL] /_layouts/15/appinv.aspx

You can see it set up from here:
[site URL] /_layouts/15/appprincipals.aspx?Scope=Web

Here is the feature to enable:
WFAppStepFeatureToEnable

For App Step Permissions, it is the 3rd link under permissions from Site Settings.

Here is how the specific App Step Permission appears when viewed from Site Settinga App Step Permissions:
SpecificAppStepPermissionDefinition

With the permissions granted, the workflows should then work on retry. You can retry from the workflow summary page shown on top

5 replies
  1. Steve
    Steve says:

    You guys are life savors. I have been wrestling this for half a day trying to figure out why my site was not working.

    So the thing is my workflow was working up until recently. Could SharePoint admin push out the Workflows “can use app permissions” Site Feature and leave it default to not enable?

    Reply
  2. Anshu
    Anshu says:

    Hi,
    The workflow that has a “App Step”, should be developed to the same library or the list that the first workflow is created (one that gives errors). Or should we add a “App step to the same workflow”?

    Reply
    • admin
      admin says:

      A few thoughts:
      1. Don’t use the App Step unless it is truly necessary; and use as few App Steps as possible, multiple App Steps in one workflow can lead to problems
      2. Ensure configuration rights are granted, as described in the article, including setting scope URL
      3. Consider setting the permissions to avoid need for App Step
      4. An an alternative for onPremises installations, an asynchronous Event Receiver can elevate permissions and take any necessary actions

      Reply

Trackbacks & Pingbacks

  1. […] articles explain how to grant full Principal Permission to 2013 Workflow Application through GUI:  Workflow error in SP2013 related to App Step and Create Site From Template using SharePoint 2013 […]

  2. […] elevated rights to the Workflow service account… here and […]

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *