@VisibleForTesting
    List<TaskModel> filterNextLoopOverTasks(
            List<TaskModel> tasks, TaskModel pendingTask, WorkflowModel workflow) {

        // Update the task reference name and iteration
        tasks.forEach(
                nextTask -> {
                    nextTask.setReferenceTaskName(
                            TaskUtils.appendIteration(
                                    nextTask.getReferenceTaskName(), pendingTask.getIteration()));
                    nextTask.setIteration(pendingTask.getIteration());
                });

        List<String> tasksInWorkflow =
                workflow.getTasks().stream()
                        .filter(
                                runningTask ->
                                        runningTask.getStatus().equals(TaskModel.Status.IN_PROGRESS)
                                                || runningTask.getStatus().isTerminal())
                        .map(TaskModel::getReferenceTaskName)
                        .collect(Collectors.toList());

        return tasks.stream()
                .filter(
                        runningTask ->
                                !tasksInWorkflow.contains(runningTask.getReferenceTaskName()))
                .collect(Collectors.toList());
    }
Decider evaluates the state of the workflow by inspecting the current state along with the
blueprint. The result of the evaluation is either to schedule further tasks, complete/fail the
workflow or do nothing.
core/src/main/java/com/netflix/conductor/core/execution/DeciderService.java