We have Nintex workflow 2013 and it's running on a SharePoint 2013 on premise environment.
Is it possible to provision a nintex workflow programmatically using server site c# code on a SharePoint list using a site template ? So, a new site with a list in it is created with a site template and on that list a workflow must be provisioned.
If so, is there somebody who has some sample code ?
I had a requirement of creating workflows dynamically on various different sites and the approach I used was to publish the workflows using Nintex webservice (_vti_bin/nintexworkflow/workflow.asmx) I used powershell to do my job but surely you could write code in c# and call the same webservice method (on feature activation) to publish your workflow. You could probably store workflow file (.nwf) in one of your library on your site and your feature could publish this workflow using the NIntex workflow webservice.
The method to use is PublishFromNWFXml.
Because of another urgent issue I didn't have time yet to test it. Next week I'm on vacation. I'll pick it up again after my vacation and let you know.