InvokeRouteBuilder.WithName Method

Definition

Overloads

Name Description
WithName(String)

Configures the route to match only invoke activities with the specified name.

WithName(Regex)

Configures the route to match invoke activities whose name matches the specified regular expression pattern.

WithName(String)

Configures the route to match only invoke activities with the specified name.

public Microsoft.Agents.Builder.App.InvokeRouteBuilder WithName(string name);
member this.WithName : string -> Microsoft.Agents.Builder.App.InvokeRouteBuilder
Public Function WithName (name As String) As InvokeRouteBuilder

Parameters

name
String

The name of the invoke activity to match. Comparison is case-insensitive.

Returns

A InvokeRouteBuilder instance with the added selector for matching Activity.Name.

Remarks

This method restricts the route to handle only invoke activities whose Name property matches the specified value. If the route is marked as agentic, the request must also be authorized as agentic to match.

Applies to

WithName(Regex)

Configures the route to match invoke activities whose name matches the specified regular expression pattern.

public Microsoft.Agents.Builder.App.InvokeRouteBuilder WithName(System.Text.RegularExpressions.Regex namePattern);
member this.WithName : System.Text.RegularExpressions.Regex -> Microsoft.Agents.Builder.App.InvokeRouteBuilder
Public Function WithName (namePattern As Regex) As InvokeRouteBuilder

Parameters

namePattern
Regex

A regular expression used to match the name of incoming invoke activities. Only activities with a name that matches this pattern will be handled by the route.

Returns

A InvokeRouteBuilder instance configured with the specified Activity.Name pattern selector.

Remarks

This method restricts the route to handle only invoke activities with names matching the provided pattern. If the route is marked as agentic, it will only match agentic requests. Use this method to filter invoke activities based on their name when defining route handlers.

Applies to