Inability to list workflow executions with test environment

Hello,

I am designing an endpoint to list some information about executions of various workflows. This is available in the example: io.temporal.samples.listworkflows. When I run this code using a TestWorkflowEnvironment I get the exception:


io.grpc.StatusRuntimeException: UNIMPLEMENTED: Method temporal.api.workflowservice.v1.WorkflowService/ListWorkflowExecutions is unimplemented
	at io.grpc.stub.ClientCalls.toStatusRuntimeException(ClientCalls.java:271)
	at io.grpc.stub.ClientCalls.getUnchecked(ClientCalls.java:252)
...

I wonder if there is a mode in which I must put the TestWorkflowEnvironment in order for this to work or if ListWorkflowExecutionsResponse is not supported when using TestWorkflowEnvironment?

Thanks,

Matt

Any observations welcome including “why would you want that” or “it works for me”… Thanks :slight_smile:

Hello @Matthew_Gerring

The method is not implemented for the environment. You can use ListOpenWorkflowExecutionsRequest or LisClosedWorkflowExecutionsRequest instead.

“why would you want that”?

Antonio

I want to have endpoints for returning all the temporal queue information in order to build my own queue UI. I do not want to expose temporal endpoints on the internet and prefer to wrap the functionality. Then in order to test this, I need to start a test temporal environment. If you can think of a better way, very interested to know.

It makse sense @Matthew_Gerring

There is an open issue to support listworkflowexecutions in test environment Support listWorkflowExecutions in test server · Issue #1693 · temporalio/sdk-java · GitHub

I got issue with list schedules

UNIMPLEMENTED: Method temporal.api.workflowservice.v1.WorkflowService/ListSchedules is unimplemented

Can I do anything here?
This is my method -

ListSchedulesResponse listSchedulesResponse =
        workflowClient.getWorkflowServiceStubs().blockingStub().listSchedules(listSchedulesRequest);
    listSchedulesResponse
        .getSchedulesList()
        .forEach(
            element -> {
              String workflowTpe = element.getInfo().getWorkflowType().getName();
              if (workflowTpe.equals(scheduleId)) {
                workflowClient
                    .getWorkflowServiceStubs()
                    .blockingStub()
                    .deleteSchedule(
                        DeleteScheduleRequest.newBuilder()
                            .setNamespace(workflowClient.getOptions().getNamespace())
                            .setScheduleId(element.getScheduleId())
                            .build());
              }
            });