public static RunResponse from(WorkflowInstance instance, int state) {
    return RunResponse.builder()
        .workflowId(instance.getWorkflowId())
        .workflowVersionId(instance.getWorkflowVersionId())
        .workflowInstanceId(instance.getWorkflowInstanceId())
        .workflowRunId(instance.getWorkflowRunId())
        .workflowUuid(instance.getWorkflowUuid())
        .status(Status.fromCode(state))
        .timelineEvent(instance.getInitiator().getTimelineEvent())
        .build();
  }
@Test
  public void testBuildFromEvent() {
    RunResponse res = RunResponse.from(stepInstance, TimelineLogEvent.info("bar"));
    Assert.assertEquals(RunResponse.Status.STEP_ATTEMPT_CREATED, res.getStatus());
  }