Problem:
I have a list with permission for users to Add or View an Item. Once item added the users are not allowed to edit. In this list there is an ItemAdded SPD workflow which runs under App Step with elevated permission.
The App Step Elevated permission steps are well documented on MSDN
Create a workflow with elevated permissions by using the SharePoint Workflow platform
Even after all the App Step I got the following error in the item added workflow:
Retrying last request. Next attempt scheduled after 10/2/2018 4:50 PM.
Details of last request: HTTP Forbidden to https://{tenantname}.sharepoint.com/sites/test1/_api/web/lists(guid’95594e70-d007-44a8-9baa-cb714d15bda6′)/Items(204) Correlation Id: 866d4444-8807-5c84-a37c-0d1054fd9640
Instance Id: 6f29bdbe-4b05-4e18-8b5b-d3cc8b830a3f
After searching on the web to find why this was an error, I found the following article which helped me resolve the issue. In summary, I had to turn off the “Automatically update the workflow status to the current stage”
SharePoint 2013: SharePoint Designer Workflow in Suspended or Canceled State
Cause
When the “Automatically update the workflow status to the current stage” name option is selected in SharePoint Designer, SharePoint must edit the list page to change the workflow status. A user needs edit permissions on the list to edit the workflow status. If a user does not have edit permissions on the list, the workflow enters a suspended state.
Sharing it…to save few hours. It took me few hours to figure out in spite of elevated App Only permission the SPD workflow fails for only Add or View Items permission list.