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 testRunStrategy() throws IOException {
    WorkflowDefinition definitionParallelRunStrategy =
        loadObject(
            "fixtures/workflows/definition/sample-minimal-wf-run-strategy-parallel.json",
            WorkflowDefinition.class);
    definitionParallelRunStrategy.getMetadata().setWorkflowVersionId(1L);
    WorkflowInstance instanceParallelRunStrategy =
        loadObject(
            "fixtures/instances/sample-workflow-instance-created.json", WorkflowInstance.class);
    instanceParallelRunStrategy.setWorkflowId("sample-minimal-wf-run-strategy-parallel");
    when(workflowDao.getWorkflowDefinition("sample-minimal-wf-run-strategy-parallel", "active"))
        .thenReturn(definitionParallelRunStrategy);
    AtomicReference<WorkflowInstance> instanceRef = new AtomicReference<>();
    doAnswer(
            (Answer<Integer>)
                invocation -> {
                  WorkflowInstance instance = (WorkflowInstance) invocation.getArguments()[0];
                  assertEquals(0L, instance.getWorkflowInstanceId());
                  assertEquals(0L, instance.getWorkflowRunId());
                  instance.setWorkflowInstanceId(1L);
                  instance.setWorkflowRunId(1L);
                  instanceRef.set(instance);
                  return 1;
                })
        .when(runStrategyDao)
        .startWithRunStrategy(any(), any());
    RunRequest request =
        RunRequest.builder()
            .initiator(new ManualInitiator())
            .currentPolicy(RunPolicy.START_FRESH_NEW_RUN)
            .requestId(UUID.fromString("41f0281e-41a2-468d-b830-56141b2f768b"))
            .build();
    actionHandler.start("sample-minimal-wf", "active", request);
    verify(runStrategyDao, times(1))
        .startWithRunStrategy(instanceRef.get(), Defaults.DEFAULT_RUN_STRATEGY);
    actionHandler.start("sample-minimal-wf-run-strategy-parallel", "active", request);
    assertEquals(
        RunStrategy.Rule.PARALLEL,
        definitionParallelRunStrategy.getRunStrategyOrDefault().getRule());
    verify(runStrategyDao, times(1))
        .startWithRunStrategy(
            instanceRef.get(), definitionParallelRunStrategy.getRunStrategyOrDefault());
  }