Hi, K2 workflow starts depending on a user whoever starts the workflow manually or through console application should have start permissions for that particular process. Please check the created by user for the item which is created using console application. Also check evenviewer and log files entries.
Thanks for the suggestion. I thought about that but, for testing purposes, I am running the console application under an administor account which is an administrator on the server, in SharePoint, on the SQL Server, and also in K2. When I create the list item manually using the same account, the K2 workflow runs, so I don't believe permissions are the problem. I've checked the event viewer and set K2 logging to the filesystem to "All" and don't see any messages in either that seem to relate to this. In fact, when the I run the console app and create the list item the K2 log doesn't receive any entries at all so K2 isn't even being invoked.
To double-check this, I created another K2 workflow with only a single activity and attached it to another list then built a new consolve app to generate a list item. I got the same results.
So I'm wondering if there is something additional I need to configure.
I've taken the approach of running code in a .Net application to programmatically start the workflow after data is inserted in SharePoint. The workflow appears to start in SharePoint but the K2 workflow does not start. Does anyone know if there is a way to force it?
It looks like you're creating a workaround for something that should and typcially works fine out of the box after configuration. You might be better off submitting a support ticket and getting the underlying issue resolved rather than trying the workarounds.
I wonder if the K2 components have been successfully configured on this site collection. You might want to test a new site collection and enable the K2 components on that and try again. Also ensure that the K2 Service is added to the Site collection administrators groups and added to the SharePoint Farm Administrators group as well for the SharePoint Integrated Workflow component. Also ensure that the SharePoint application pool that the SharePoint web application runs under has Administrator, Export and Impersonate permissions enabled in the K2 Server.
Actually I've confirmed with K2 that this is exactly the expected behaviour. A SharePoint Integration Process only runs when a user interactively creates the list item or document in SharePoint. I've been given some good directions to follow and the most recent is to look at the K2 API and specifically the Sourcecode.Workflow.Client namespace. Unfortunately, none of the documentation refers to how to use this in the context of a SharePoint item. I'm hoping someone can point me in the right direction.