Have a provider hosted app that connects to my SPO 2013/O365 instance via App Only authentication. When the user submits through the app it creates a list item. I have a 2010 workflow set to kick off on item creation, grab an email address from a field, and send an email to that address, but for some reason the workflow never triggers. Heres what Ive tried/seen:
I can start the workflow manually and it works as expected.
I can have 2013 workflows trigger as expected.
I tried having the 2013 workflow start the 2010 workflow, but I get Access Denied when it tries to run the 2010 workflow. The other portions of the 2013 workflow run fine.
Tried wrapping the action to run the 2010 workflow in an App Step, but you cant use the Start 2010 workflow in an App Step.
Modified the 2010 workflow to only log a quick message to eliminate the possibility that its something with the workflow itself.
Ive given the app full control over the site collection.
Ive given everyone full control over the site collection.
Ive enabled Workflows can use app permissions feature.
Ive added the following to my AppManifest:
<AppPermissionRequests AllowAppOnlyPolicy="true" > <AppPermissionRequest Scope="http://sharepoint/content/sitecollection/web" Right="FullControl" /> </AppPermissionRequests>
When I create a list item through the list itself rather than via the app everything works as expected. That includes running the 2010 workflow by itself as well as having the 2013 workflow kick off the 2010 workflow.
Still, nothing works. When I try and have the 2010 workflow run by itself on item creation its like its not even there. No errors, no logs.
Not sure if it could possibly be related to the way Im creating the item, but heres my code anyway:
List list = clientContext.Web.Lists.GetByTitle("List"); ListItemCreationInformation info = new ListItemCreationInformation(); Microsoft.SharePoint.Client.ListItem item = list.AddItem(info); item.Update(); clientContext.Load(item); clientContext.ExecuteQuery();
Im thinking that its either impossible to kick off the 2010 workflow from a 2013 app, or theres some other code I need to add to make it happen. Havent been able to find an answer to either yet.