public static void AddWorklfowTemplate() { try { bool exists = false; SPSolutionCollection solutionCollection = SPFarm.Local.Solutions; foreach (SPSolution sol in solutionCollection) { if (sol.Name.ToLower() == "spdg workflow.wsp") { exists = true; break; } } if (!exists) { SPSolution solution = SPFarm.Local.Solutions.Add("SampleData\\SPDG Workflow.wsp"); solution.DeployLocal(true, true); } } catch (Exception ex) { Errors.Log(ex); } }