How to get the workflow execution details other than Temporal web UI


As we are yet to implement the authentication in Temporal web UI we wanted to find the details of a workflow execution from temporal-cli or from some other source.

We wanted to get the Summary, History, Stacktrace, and Query details of workflow execution.

Is there any way to get that?


You can get the stack trace for running workflow executions via the QueryWorkflowRequest and the built-in “__stack_trace” query, for example:

QueryWorkflowRequest req =
        QueryWorkflowResponse res = service.blockingStub().queryWorkflow(req);
        String trace = res.getQueryResult();

If you have the workflow id and runid as string you can build your WorkflowExecution instance with for example:

WorkflowExecution execution = WorkflowExecution.newBuilder()


You can get this via DescribeWorkflowExecution api, for example:

DescribeWorkflowExecutionRequest req =
            DescribeWorkflowExecutionResponse res =

The top section info of the web-ui summary page you can get via

WorkflowExecutionInfo info = res.getWorkflowExecutionInfo();
// ....

Pending activities are also available from the response:

List<PendingActivityInfo> pendingActivitiesList = describeWorkflowExecutionResponse.getPendingActivitiesList();


You can get workflow history as JSON via SDK as well, via GetWorkflowExecutionHistory api:

GetWorkflowExecutionHistoryRequest request =
        String history = new WorkflowExecutionHistory(


You can use QueryWorkflow api like with the stack trace but provide your query type (query name which is by default the name of your QueryMethod).

Thanks for the response @tihomir

It can be only done via Java Code.
Can we achieve it from temporal-cli or by querying the database?

You should not have to query your db for any of this (its also not recommended), rather use tctl (cli) or your sdk apis.

For tctl:

Stack trace

tctl wf stack -h


tctl wf query -h


tctl wf show -h

to store json to file:
tctl wf show -w <wfid> -r <runid> --output_filename myhistory.json


tctl wf desc -h

There is also docs on this here.