I would like to cancel or kill an instance using API in activiti. All I need to stop the instance from run but I dont want to delete the instance and remove it from engine. need to cancel/complete with a reason and keep it available in history table.
Also Is there an option to Cancel a deployment or set a deployment status to Completed status using an API so no future instances can be started.
runtimeService.deleteProcessInstance gives you that. History is kept in the database.
For your seconding question: not for a deployment, but you can suspend all process definition of a deployment separately, which gives you the same behavior.