DeclarativeWorkflowHandlers
NexusLabs.Foundry.MicrosoftAgentFramework.Workflows.Declarative¶
DeclarativeWorkflowHandlers Class¶
The handlers a declarative workflow calls out through when a document invokes something that is not a Foundry agent.
public sealed record DeclarativeWorkflowHandlers : System.IEquatable<NexusLabs.Foundry.MicrosoftAgentFramework.Workflows.Declarative.DeclarativeWorkflowHandlers>
Inheritance System.Object 🡒 DeclarativeWorkflowHandlers
Implements System.IEquatable<DeclarativeWorkflowHandlers>
Remarks¶
A declarative document can reach outside the workflow in three ways: it can invoke an agent, an MCP server tool, or an HTTP endpoint. Agent invocation is always wired, because resolving agents against Foundry's declarations is the reason this package exists. The other two are not, because each reaches a network endpoint the host — not the document, and not Foundry — must decide to trust.
Both members are required so that decision is stated rather than defaulted.
Supplying null is a valid answer meaning "documents may not invoke this"; what
is not available is leaving the question unanswered and discovering the omission when an action
fails mid-run. Callers whose documents invoke neither should use the
CreateDeclarativeWorkflow overloads that take no handlers at all.
Foundry supplies no implementation of either interface. An implementation decides which servers
and endpoints may be reached, what credentials are attached, and what timeout and retry policy
applies; none of that is knowable here. Microsoft.Agents.AI.Workflows.Declarative.Mcp
provides DefaultMcpToolHandler, and Microsoft.Agents.AI.Workflows.Declarative.DefaultHttpRequestHandler ships in the
package this one already depends on.
Properties¶
DeclarativeWorkflowHandlers.HttpRequestHandler Property¶
Gets the handler invoked for an HTTP action, or null to leave HTTP invocation unavailable.
public Microsoft.Agents.AI.Workflows.Declarative.IHttpRequestHandler? HttpRequestHandler { get; init; }
Property Value¶
Microsoft.Agents.AI.Workflows.Declarative.IHttpRequestHandler
Remarks¶
Microsoft.Agents.AI.Workflows.Declarative.DefaultHttpRequestHandler is an unrestricted implementation: it sends whatever the document asks for, to wherever the document names. That is appropriate for a trusted document and a poor default for one that is not, which is why it is not wired automatically.
DeclarativeWorkflowHandlers.McpToolHandler Property¶
Gets the handler invoked for an InvokeMcpTool action, or null to
leave MCP tool invocation unavailable.
Property Value¶
Microsoft.Agents.AI.Workflows.Declarative.IMcpToolHandler
Remarks¶
The action supplies the handler with the document's serverUrl and toolName,
which are required, and its optional serverLabel, arguments, headers,
and connectionName. Argument values are Power Fx expressions evaluated against
workflow state before the handler sees them, so a handler receives resolved values rather
than expression text.
When this is null and a document contains an InvokeMcpTool action,
the document is rejected while the workflow is being built, not when the action runs. That
makes an unwired handler one of the few authoring faults
ValidateDeclarativeWorkflow does catch.