private TaskModel taskToBeRescheduled(WorkflowModel workflow, TaskModel task) {
        TaskModel taskToBeRetried = task.copy();
        taskToBeRetried.setTaskId(idGenerator.generate());
        taskToBeRetried.setRetriedTaskId(task.getTaskId());
        taskToBeRetried.setStatus(SCHEDULED);
        taskToBeRetried.setRetryCount(task.getRetryCount() + 1);
        taskToBeRetried.setRetried(false);
        taskToBeRetried.setPollCount(0);
        taskToBeRetried.setCallbackAfterSeconds(0);
        taskToBeRetried.setSubWorkflowId(null);
        taskToBeRetried.setScheduledTime(0);
        taskToBeRetried.setStartTime(0);
        taskToBeRetried.setEndTime(0);
        taskToBeRetried.setWorkerId(null);
        taskToBeRetried.setReasonForIncompletion(null);
        taskToBeRetried.setSeq(0);

        // perform parameter replacement for retried task
        Map<String, Object> taskInput =
                parametersUtils.getTaskInput(
                        taskToBeRetried.getWorkflowTask().getInputParameters(),
                        workflow,
                        taskToBeRetried.getWorkflowTask().getTaskDefinition(),
                        taskToBeRetried.getTaskId());
        taskToBeRetried.getInputData().putAll(taskInput);

        task.setRetried(true);
        // since this task is being retried and a retry has been computed, task lifecycle is
        // complete
        task.setExecuted(true);
        return taskToBeRetried;
    }
Reschedule a task

@param task failed or cancelled task
@return new instance of a task with "SCHEDULED" status
core/src/main/java/com/netflix/conductor/core/execution/WorkflowExecutor.java