listArchivedWorkflowExecutions lists unarchived workflows aswell

I’m invoking listArchivedWorkflowExecutions against a wfid.
The results of this method includes both archived and unachieved workflow.

Questions

  1. Is this an expected behaviour?
  2. Will this behaviour remain the same even in future?
    private List<WorkflowExecutionInfo> getArchivedWFExecutions(String query) {
        return this.workflowServiceStub.listArchivedWorkflowExecutions(this.getListArchivedWorkflowExecutionsRequest(query)).getExecutionsList();
    }

    private ListArchivedWorkflowExecutionsRequest getListArchivedWorkflowExecutionsRequest(String query) {
        return ListArchivedWorkflowExecutionsRequest.newBuilder().setQuery(query).setNamespace(this.temporalServerConfiguration.getWorkflow().getWorkflowNamespace()).build();
    }

    private String constructQuery(String workflowId) {
        return String.format("WorkflowId ='%s'", workflowId);
    }
  1. Yes can reproduce this, believe it has to do with ListArchivedWorkflowExecutions, just like ListWorkflowExecutions gets data from visibility store, and visibility archival currently happens right after workflow closes. This is unlike workflow history archival that happens after retention period.

  2. We should open an issue so its fixed. Can you please open one here?

Done - https://github.com/temporalio/temporal/issues/2457

1 Like