public async Task <PendingWorkflow> DispatchStartableWorkflowAsync(StartableWorkflow startableWorkflow, object?input, CancellationToken cancellationToken = default) { var pendingWorkflow = new PendingWorkflow(startableWorkflow.WorkflowInstance.Id, startableWorkflow.ActivityId); await ExecutePendingWorkflowAsync(pendingWorkflow, input, cancellationToken); return(pendingWorkflow); }
private async Task <RunWorkflowResult> ExecuteStartableWorkflowAsync(StartableWorkflow startableWorkflow, WorkflowInput?input, CancellationToken cancellationToken = default) => await _workflowRunner.RunWorkflowAsync(startableWorkflow.WorkflowBlueprint, startableWorkflow.WorkflowInstance, startableWorkflow.ActivityId, input, cancellationToken);