public List<String> getRunningWorkflows(
            String workflowName, Integer version, Long startTime, Long endTime) {
        if (Optional.ofNullable(startTime).orElse(0L) != 0
                && Optional.ofNullable(endTime).orElse(0L) != 0) {
            return workflowExecutor.getWorkflows(workflowName, version, startTime, endTime);
        } else {
            version =
                    Optional.ofNullable(version)
                            .orElseGet(
                                    () -> {
                                        WorkflowDef workflowDef =
                                                metadataService.getWorkflowDef(workflowName, null);
                                        return workflowDef.getVersion();
                                    });
            return workflowExecutor.getRunningWorkflowIds(workflowName, version);
        }
    }
Retrieves all the running workflows.

@param workflowName Name of the workflow.
@param version Version of the workflow.
@param startTime start time of the workflow.
@param endTime EndTime of the workflow
@return a list of workflow Ids.
core/src/main/java/com/netflix/conductor/service/WorkflowServiceImpl.java