code: private static void deleteStoppedHelixJob(HelixManager helixManager, String workFlowName, String jobName)
        throws InterruptedException {
      WorkflowContext workflowContext = TaskDriver.getWorkflowContext(helixManager, workFlowName);
      while (workflowContext.getJobState(TaskUtil.getNamespacedJobName(workFlowName, jobName)) != STOPPED) {
        log.info("Waiting for job {} to stop...", jobName);
        workflowContext = TaskDriver.getWorkflowContext(helixManager, workFlowName);
        Thread.sleep(1000);
      }
      // deleting the entire workflow, as one workflow contains only one job
      new TaskDriver(helixManager).deleteAndWaitForCompletion(workFlowName, 10000L);
      log.info("Workflow deleted.");
    }
docs: Deletes the stopped Helix Workflow.
  Caller should stop the Workflow before calling this method.
  @param helixManager helix manager
  @param workFlowName workflow needed to be deleted
  @param jobName helix job name
  @throws InterruptedException