@Override
        public boolean isValid(WorkflowDef workflowDef, ConstraintValidatorContext context) {
            context.disableDefaultConstraintViolation();

            boolean valid = true;

            // check if taskReferenceNames are unique across tasks or not
            HashMap<String, Integer> taskReferenceMap = new HashMap<>();
            for (WorkflowTask workflowTask : workflowDef.collectTasks()) {
                if (taskReferenceMap.containsKey(workflowTask.getTaskReferenceName())) {
                    String message =
                            String.format(
                                    "taskReferenceName: %s should be unique across tasks for a given workflowDefinition: %s",
                                    workflowTask.getTaskReferenceName(), workflowDef.getName());
                    context.buildConstraintViolationWithTemplate(message).addConstraintViolation();
                    valid = false;
                } else {
                    taskReferenceMap.put(workflowTask.getTaskReferenceName(), 1);
                }
            }
            // check inputParameters points to valid taskDef
            return valid & verifyTaskInputParameters(context, workflowDef);
        }
This constraint class validates following things.

<ul>
  <li>1. WorkflowDef is valid or not
  <li>2. Make sure taskReferenceName used across different tasks are unique
  <li>3. Verify inputParameters points to correct tasks or not
</ul>
common/src/main/java/com/netflix/conductor/common/constraints/TaskReferenceNameUniqueConstraint.java