public List<Workflow> getWorkflowInstances(
            String workflowName,
            String correlationId,
            boolean includeClosed,
            boolean includeTasks) {

        List<Workflow> workflows =
                executionDAOFacade.getWorkflowsByCorrelationId(workflowName, correlationId, false);
        return workflows.stream()
                .parallel()
                .filter(
                        workflow -> {
                            if (includeClosed
                                    || workflow.getStatus()
                                            .equals(Workflow.WorkflowStatus.RUNNING)) {
                                // including tasks for subset of workflows to increase performance
                                if (includeTasks) {
                                    List<Task> tasks =
                                            executionDAOFacade.getTasksForWorkflow(
                                                    workflow.getWorkflowId());
                                    tasks.sort(Comparator.comparingInt(Task::getSeq));
                                    workflow.setTasks(tasks);
                                }
                                return true;
                            } else {
                                return false;
                            }
                        })
                .collect(Collectors.toList());
    }
This method removes the task from the un-acked Queue

@param taskId: the taskId that needs to be updated and removed from the unacked queue
@return True in case of successful removal of the taskId from the un-acked queue
core/src/main/java/com/netflix/conductor/service/ExecutionService.java