public boolean registerWorkflow(boolean overwrite, boolean registerTasks) {
        WorkflowDef workflowDef = toWorkflowDef();
        List<String> missing = getMissingTasks(workflowDef);
        if (!missing.isEmpty()) {
            if (!registerTasks) {
                throw new RuntimeException(
                        "Workflow cannot be registered.  The following tasks do not have definitions.  "
                                + "Please register these tasks before creating the workflow.  Missing Tasks = "
                                + missing);
            } else {
                String ownerEmail = this.ownerEmail;
                missing.stream().forEach(taskName -> registerTaskDef(taskName, ownerEmail));
            }
        }
        return workflowExecutor.registerWorkflow(workflowDef, overwrite);
    }
@param overwrite set to true if the workflow should be overwritten if the definition already
    exists with the given name and version. <font color=red>Use with caution</font>
@param registerTasks if set to true, missing task definitions are registered with the default
    configuration.
@return true if success, false otherwise.
java-sdk/src/main/java/com/netflix/conductor/sdk/workflow/def/ConductorWorkflow.java