public WorkflowInstance.Status getWorkflowInstanceStatus(
      String workflowId, long workflowInstanceId, long workflowRunId) {
    String status = getWorkflowInstanceRawStatus(workflowId, workflowInstanceId, workflowRunId);
    return withMetricLogError(
        () -> {
          if (status == null) {
            return null;
          }
          return WorkflowInstance.Status.create(status);
        },
        "getWorkflowInstanceStatus",
        "Failed to parse the workflow instance status [{}] for [{}][{}][{}]",
        status,
        workflowId,
        workflowInstanceId,
        workflowRunId);
  }
@Test
  public void testGetWorkflowInstanceStatus() {
    WorkflowInstance.Status status =
        instanceDao.getWorkflowInstanceStatus(
            wfi.getWorkflowId(), wfi.getWorkflowInstanceId(), wfi.getWorkflowRunId());
    assertEquals(WorkflowInstance.Status.CREATED, status);
    boolean res =
        instanceDao.tryTerminateQueuedInstance(wfi, WorkflowInstance.Status.FAILED, "test-reason");
    assertTrue(res);
    status =
        instanceDao.getWorkflowInstanceStatus(
            wfi.getWorkflowId(), wfi.getWorkflowInstanceId(), wfi.getWorkflowRunId());
    assertEquals(WorkflowInstance.Status.FAILED, status);
  }