Workfllow triggering issue for an item created by provider hosted app


Badge +1

We have  implemented a simple workflow in a SharePoint List. The workflow is configured to triggered on list item creation. The site is consuming a provider hosted app  which has logic to create new list items in the above mentioned list. ISSUE: The workflow is not getting triggered if item is created from the SharePoint app. Errors from logs are as below:

"Declarative workflows cannot automatically start if the triggering action was performed by an App-Only request. Canceling workflow auto-start."

---

"Trusted provider is missing. Provider: '00000003-0000-0ff1-ce00-000000000000'"

-----
SPRequest.GetListsWithCallback: UserPrincipalName=i:0i.t|00000003-0000-0ff1-ce00-000000000000|app@sharepoint, AppPrincipalName= ,bstrUrl=xxxxxxxxx,foreignWebId=00000000-0000-0000-0000-000000000000 ,bstrListInternalName={600E83A7-BBD7-45CC-9722-BAE24CF74EBB} ,dwBaseType=-1 ,dwBaseTypeAlt=-1 ,dwServerTemplate=-1 ,dwGetListFlags=0 ,dwListFilterFlags=4294967295 ,bPrefetchMetaData=False ,bSecurityTrimmed=True ,bGetSecurityData=True ,bPrefetchRelatedFields=False

---- 

System.UnauthorizedAccessException: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)), StackTrace:    at Microsoft.SharePoint.SPListCollection.EnsureListsData(Guid webId, String strListName)     at Microsoft.SharePoint.SPListCollection.ItemByInternalName(String strInternalName, Boolean bThrowException)     at Microsoft.SharePoint.SPListCollection.GetListById(Guid uniqueID, Boolean bThrowException)     at phM=.xhM=.zhM=(List`1 zxM=, Boolean 0BM=, SPWeb 0RM=)     at Nintex.Workflow.Activities.QueryListActivity.PerformListQuery(XmlNode caml, SPWeb web, NWWorkflowContext ctx, Int32 _itemLimit, Int32 _UnlimitedItemCount)     at Nintex.Workflow.Activities.QueryListActivity.Execute(ActivityExecutionContext executionContext)  .....................
 

Request your help to solve this. Thanks in advance.


5 replies

Badge +1

Request your assistance to solve this issue. Thanks.

Userlevel 6
Badge +16

Perhaps that's because the item is created by a system account.

Any workflow will start on items created in any way by a System Account.

Badge +1

No.. Its crated from provider hosted app. As the logs given in the question, the item created is created by app and created by is shown as app@sharepoint . Please let us know your thoughts? or any other work around?

Badge +1

I have the exact issue in my O365 site. Initiator is displayed as app@sharepoint. Let me know you have found any solution.

Badge +1

Try activating 'Workflows can use app permissions' feature for the site. It helped me to resolve the issue.

205860_pastedImage_1.png

Reply