public RunResponse start(
      @NotNull String workflowId, @NotNull String version, @NotNull RunRequest runRequest) {
    WorkflowDefinition definition = workflowDao.getWorkflowDefinition(workflowId, version);

    validateRequest(version, definition, runRequest);

    RunProperties runProperties =
        RunProperties.from(
            Checks.notNull(
                definition.getPropertiesSnapshot(),
                "property snapshot cannot be null for workflow: " + workflowId));
    // create and initiate a new instance with overrides and param evaluation
    WorkflowInstance instance =
        workflowHelper.createWorkflowInstance(
            definition.getWorkflow(),
            definition.getInternalId(),
            definition.getMetadata().getWorkflowVersionId(),
            runProperties,
            runRequest);
    RunStrategy runStrategy = definition.getRunStrategyOrDefault();
    int ret = runStrategyDao.startWithRunStrategy(instance, runStrategy);
    RunResponse response = RunResponse.from(instance, ret);
    LOG.info("Created a workflow instance with response {}", response);
    return response;
  }
@Test
  public void testStartSubworkflow() {
    doAnswer(
            (Answer<Integer>)
                invocation -> {
                  WorkflowInstance instance = (WorkflowInstance) invocation.getArguments()[0];
                  assertEquals(0L, instance.getWorkflowInstanceId());
                  assertEquals(0L, instance.getWorkflowRunId());
                  instance.setWorkflowInstanceId(1L);
                  instance.setWorkflowRunId(10L);
                  return 1;
                })
        .when(runStrategyDao)
        .startWithRunStrategy(any(), any());
    SubworkflowInitiator initiator = new SubworkflowInitiator();
    initiator.setAncestors(Collections.singletonList(new UpstreamInitiator.Info()));
    RunRequest request =
        RunRequest.builder()
            .initiator(initiator)
            .requestId(UUID.fromString("41f0281e-41a2-468d-b830-56141b2f768b"))
            .currentPolicy(RunPolicy.START_FRESH_NEW_RUN)
            .build();
    WorkflowSummary summary = new WorkflowSummary();
    summary.setWorkflowRunId(10L);
    RunResponse response = actionHandler.start("sample-minimal-wf", "active", request);
    verify(workflowDao, times(1)).getWorkflowDefinition("sample-minimal-wf", "active");
    verify(runStrategyDao, times(1)).startWithRunStrategy(any(), any());
    assertEquals(instance.getWorkflowId(), response.getWorkflowId());
    assertEquals(1L, response.getWorkflowVersionId());
    assertEquals(10L, response.getWorkflowRunId());
    assertEquals("41f0281e-41a2-468d-b830-56141b2f768b", response.getWorkflowUuid());
    assertEquals(RunResponse.Status.WORKFLOW_RUN_CREATED, response.getStatus());
  }