To run an executable from within a workflow k2 for visual studios should be used, as we will need to execute custom code from within the workflow which can easily be done from K2 for Visual Studio.
Firstly, on the workflow we will need to add a server event.
Right click on the server event and select View Code and then Event Item.
After event item was selected a new tab will open in Visual Studio.
We can then add code to start an external application with parameters as shown in the following example
This snipped of code will execute the “Executable.exe” on the local server as specified by the location @”c:TempExecutable.exe” with a parameter in this case being a value received from the “K2.ProcessInstance.folio”
note that after the executable filename and path the “,” comma character allows you to add an argument.
This project can then be deployed and the Application specified in the custom code will be executed on this event in the workflow.
For executing external applications from within a workflow over a network, the following link may server as some guide lines on how this can be achieved.