# How can I list open workflows (Java)?

**URL:** <https://community.temporal.io/t/how-can-i-list-open-workflows-java/315>\
**Category:** Community Support\
**Created:** [July 30, 2020, 7:08am UTC](https://community.temporal.io/t/how-can-i-list-open-workflows-java/315 "2020-07-30T07:08:52Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![sdonovan](https://avatars.discourse-cdn.com/v4/letter/s/35a633/32.png) [@sdonovan](https://community.temporal.io/u/sdonovan)\
**Post date:** [July 30, 2020, 7:08am UTC](https://community.temporal.io/t/how-can-i-list-open-workflows-java/315/1 "2020-07-30T07:08:52Z")

</div>

Greetings. Apologies if this is a trivial question. I cannot make WorkflowServiceStubs#listOpenWorkflowExecutions(…) return anything. I’m using the following:

```
ListOpenWorkflowExecutionsRequest request = ListOpenWorkflowExecutionsRequest.newBuilder()
    .setNamespace("default")
    .setStartTimeFilter(StartTimeFilter.newBuilder().setEarliestTime(0).build())
    .setTypeFilter(WorkflowTypeFilter.newBuilder().setName("TenantMigrationWorkflow"))
    .build();

ListOpenWorkflowExecutionsResponse response =
    WorkflowServiceStubs.newInstance(workflowServiceStubsOptions)
        .blockingStub()
        .listOpenWorkflowExecutions(request);

```

And attached is a console screenshot to prove that I have matching workflows.

 ![Screen Shot 2020-07-30 at 12.05.33 AM](https://us1.discourse-cdn.com/flex016/uploads/temporal/original/1X/55816a9aab63f2175c6eec1f9611c901e7abf2a7.png)

I feel like I’ve done something stupid, but I can’t see it.

Any ideas?

Sean

---

<div class="post-metadata">

**Author:** ![ryland](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/ryland/32/11_2.png) [@ryland](https://community.temporal.io/u/ryland)\
**Post date:** [July 30, 2020, 4:25pm UTC](https://community.temporal.io/t/how-can-i-list-open-workflows-java/315/2 "2020-07-30T16:25:18Z")

</div>

Hey some of these filters may not be compatible. We’re going to investigate on our side but can I ask if it works without any filters?

---

<div class="post-metadata">

**Author:** ![sdonovan](https://avatars.discourse-cdn.com/v4/letter/s/35a633/32.png) [@sdonovan](https://community.temporal.io/u/sdonovan)\
**Post date:** [July 30, 2020, 4:39pm UTC](https://community.temporal.io/t/how-can-i-list-open-workflows-java/315/3 "2020-07-30T16:39:13Z")

</div>

So Namespace and StartTimeFilter are required/mandated. If I try it without the StartTimeFilter, no workflow instances are returned (there were 3 running when I tried it).

I noticed that the UI is using http, should I just use that in the interim?

Sean

---

<div class="post-metadata">

**Author:** ![ryland](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/ryland/32/11_2.png) [@ryland](https://community.temporal.io/u/ryland)\
**Post date:** [July 30, 2020, 4:50pm UTC](https://community.temporal.io/t/how-can-i-list-open-workflows-java/315/4 "2020-07-30T16:50:00Z")

</div>

What about without the type filter?

Temporal web does not yet support TLS.

---

<div class="post-metadata">

**Author:** ![maxim](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/maxim/32/8_2.png) [@maxim](https://community.temporal.io/u/maxim)\
**Post date:** [July 30, 2020, 4:56pm UTC](https://community.temporal.io/t/how-can-i-list-open-workflows-java/315/5 "2020-07-30T16:56:44Z")

</div>

The following worked for me while setting earliest time to 0 did not.

```java
    ListOpenWorkflowExecutionsRequest request =
        ListOpenWorkflowExecutionsRequest.newBuilder()
            .setNamespace("default")
            .setStartTimeFilter(
                StartTimeFilter.newBuilder()
                    .setEarliestTime(
                        TimeUnit.MILLISECONDS.toNanos(System.currentTimeMillis() - 100000))
                    .setLatestTime(
                        TimeUnit.MILLISECONDS.toNanos(System.currentTimeMillis() + 10000))
                    .build())
            .setTypeFilter(WorkflowTypeFilter.newBuilder().setName("GreetingWorkflow"))
            .build();

```

Filed [an issue](https://github.com/temporalio/temporal/issues/636) to get this looked at.

---

<div class="post-metadata">

**Author:** ![sdonovan](https://avatars.discourse-cdn.com/v4/letter/s/35a633/32.png) [@sdonovan](https://community.temporal.io/u/sdonovan)\
**Post date:** [July 30, 2020, 5:50pm UTC](https://community.temporal.io/t/how-can-i-list-open-workflows-java/315/6 "2020-07-30T17:50:31Z")

</div>

I tried a variation of that, setting to -1D and +1D and it didn’t work, I can try again. Thanks.
