Skip to content

WorkflowDefinitionValidator

Namespace AgentPrism · Assembly AgentPrism.Core.dll

Validates the structural validity of a workflow definition.

public static class WorkflowDefinitionValidator

objectWorkflowDefinitionValidator

object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

The check lives inside AgentPrism.Core because it has two consumers: the HTTP layer produces a 400 at registration time, and the workflow compiler throws an exception at run time. If written separately in two places, one could change while the other stayed behind.

Only structural rules are checked here: name, count, duplicates, pattern-field compatibility. Whether the agents actually exist in the catalog is checked at compile time; the catalog can change between registration and execution, and moving that check to registration time would give a false guarantee.

Validates the definition and throws if it is invalid.

public static void Require(WorkflowDefinition definition)

definition WorkflowDefinition

The definition to validate.

AgentPrismException

The definition is invalid.

Validates the definition.

public static string? Validate(WorkflowDefinition definition)

definition WorkflowDefinition

The definition to validate.

string?

User-facing error text; null if the definition is valid.

ArgumentNullException

definition is null.