WorkflowDefinition
AgentPrism.Abstractions.dllRepresents the full definition of a workflow, whether defined through the UI or in code.
public sealed record WorkflowDefinition : IEquatable<WorkflowDefinition>Inheritance
Section titled “Inheritance”Implements
Section titled “Implements”IEquatable<WorkflowDefinition>
Inherited Members
Section titled “Inherited Members”object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Remarks
Section titled “Remarks”A definition is a graph, not code: it only wires
together agents from the catalog. Users do not write new behavior, they
arrange existing behavior. A free-form graph (custom Executor
types) can only be defined in code, via AddWorkflow(name, factory).
WorkflowDefinition.AgentNames is a list of names only. Each name must resolve to an agent in the catalog; if it does not, compilation fails. The same rule applies to AgentDefinition.ToolNames and draws the same security boundary.
Constructors
Section titled “Constructors”WorkflowDefinition()
Section titled “ WorkflowDefinition()”public WorkflowDefinition()Properties
Section titled “Properties”AgentNames
Section titled “ AgentNames”Gets the agent names to enter the graph. Order is meaningful for WorkflowKind.Sequential; for other kinds it defines the participant set.
public IReadOnlyList<string> AgentNames { get; init; }Property Value
Section titled “Property Value”Description
Section titled “ Description”Gets the short description of what the workflow does.
public string? Description { get; init; }Property Value
Section titled “Property Value”DisplayName
Section titled “ DisplayName”Gets the display name shown in the UI. Name is used if left empty.
public string? DisplayName { get; init; }Property Value
Section titled “Property Value”HandoffInstructions
Section titled “ HandoffInstructions”Gets the extra instruction that tells the model how to decide on a handoff. Used only for WorkflowKind.Handoff.
public string? HandoffInstructions { get; init; }Property Value
Section titled “Property Value”Gets the built-in pattern to use.
public required WorkflowKind Kind { get; init; }Property Value
Section titled “Property Value”ManagerAgentName
Section titled “ ManagerAgentName”Gets the manager agent’s name. Required for WorkflowKind.Magentic, unused in other patterns.
public string? ManagerAgentName { get; init; }Property Value
Section titled “Property Value”MaxIterations
Section titled “ MaxIterations”Gets the maximum number of turns. The only guard against an infinite loop in the WorkflowKind.GroupChat, WorkflowKind.Handoff, and WorkflowKind.Magentic patterns.
public int? MaxIterations { get; init; }Property Value
Section titled “Property Value”int?
Gets the workflow’s unique name. Serves as the key in the catalog and in API routes.
public required string Name { get; init; }Property Value
Section titled “Property Value”Gets the ordered node list for a WorkflowKind.Sequential workflow that mixes agent and function nodes.
public IReadOnlyList<WorkflowNodeReference> Nodes { get; init; }Property Value
Section titled “Property Value”IReadOnlyList<WorkflowNodeReference>
Remarks
Section titled “Remarks”Empty for every definition that does not use a function node - which
keeps WorkflowDefinition.AgentNames driving the graph exactly as before this
field existed. When non-empty, WorkflowDefinition.Kind must be
WorkflowKind.Sequential and WorkflowDefinition.AgentNames must
be empty; the validator in AgentPrism.Core enforces both
rules. Microsoft Agent Framework’s ready-made builders for the other
four patterns (Concurrent, Handoff, GroupChat,
Magentic) accept only agents, so a function node cannot enter
those graphs without hand-writing their orchestration logic - out of
scope.
Whether each function name is actually registered is checked at save time (the HTTP layer, via IWorkflowFunctionCatalog) and again at compile time, unlike agent names - which are checked only at compile time because the agent catalog can change between the two. The function registry cannot: it is fixed for the lifetime of the process, so checking early gives an honest guarantee.
RequirePlanApproval
Section titled “ RequirePlanApproval”Gets whether the plan the manager agent builds must be approved by a human before execution starts. Applies only to WorkflowKind.Magentic.
public bool RequirePlanApproval { get; init; }Property Value
Section titled “Property Value”Remarks
Section titled “Remarks”When enabled, Microsoft Agent Framework publishes an external request
at the end of the first super-step; the run becomes
RunStatus.AwaitingInput and its state is written to a
checkpoint. The response is given via
POST /api/workflows/runs/{runId}/respond: the plan is either
approved or sent back with revision text.
Cost. The manager agent runs again on every turn; a revision request makes it rebuild the plan from scratch. The default of false is deliberate: a run never stalls half-way unless a definition opts in explicitly (the no-surprises rule - zero surprises).
TenantId
Section titled “ TenantId”Gets the tenant the definition belongs to. null for workflows defined in code.
public string? TenantId { get; init; }Property Value
Section titled “Property Value”UpdatedAt
Section titled “ UpdatedAt”Gets the last modification time (UTC).
public DateTimeOffset? UpdatedAt { get; init; }Property Value
Section titled “Property Value”Version
Section titled “ Version”Gets the definition version. Increments by one on every save.
public int Version { get; init; }Property Value
Section titled “Property Value”Methods
Section titled “Methods”Equals(object?)
Section titled “ Equals(object?)”public override bool Equals(object? obj)Parameters
Section titled “Parameters”obj object?
Returns
Section titled “Returns”Equals(WorkflowDefinition?)
Section titled “ Equals(WorkflowDefinition?)”public bool Equals(WorkflowDefinition? other)Parameters
Section titled “Parameters”other WorkflowDefinition?
Returns
Section titled “Returns”GetHashCode()
Section titled “ GetHashCode()”public override int GetHashCode()Returns
Section titled “Returns”ToString()
Section titled “ ToString()”public override string ToString()Returns
Section titled “Returns”Operators
Section titled “Operators”operator ==(WorkflowDefinition?, WorkflowDefinition?)
Section titled “ operator ==(WorkflowDefinition?, WorkflowDefinition?)”public static bool operator ==(WorkflowDefinition? left, WorkflowDefinition? right)Parameters
Section titled “Parameters”left WorkflowDefinition?
right WorkflowDefinition?
Returns
Section titled “Returns”operator !=(WorkflowDefinition?, WorkflowDefinition?)
Section titled “ operator !=(WorkflowDefinition?, WorkflowDefinition?)”public static bool operator !=(WorkflowDefinition? left, WorkflowDefinition? right)Parameters
Section titled “Parameters”left WorkflowDefinition?
right WorkflowDefinition?