AgentBlazor Docs

Workflows

Workflows are the main authoring model.

Register one capability class, scope it to a route, and keep the actions semantic.

Register a workflow

options.ConfigureBuilder(agentBuilder =>
{
    agentBuilder.AddWorkflow<SupportInboxCapabilities>("support-inbox", agent =>
    {
        agent.WithRoutePrefixes("/support");
    });
});

Capability class

[AgentCapability("support_inbox", Name = "Support Inbox")]
public sealed class SupportInboxCapabilities
{
    [AgentAction("Show open tickets that still need a reply")]
    public Task<CapabilityResult> ShowOpenTicketsAsync(int days = 7)
        => Task.FromResult(
            CapabilityResult.Success($"Highlighted tickets from the last {days} days."));

    [AgentAction("Draft a reply for the highlighted tickets", RequiresApproval = true)]
    public Task<CapabilityResult> DraftReplyAsync()
        => Task.FromResult(
            CapabilityResult.Success("Prepared the reply draft.")
                .WithNextActions("Review the reply", "Approve the draft"));
}

Authoring checklist

  • Keep actions semantic and user-facing.
  • Use WithRoutePrefixes(...) to scope the workflow.
  • Mark risky or mutating actions with approval.
  • Return CapabilityResult with warnings and next actions when useful.
An unhandled error has occurred. Reload 🗙

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please retry or reload the page.