How to Build AI Agents Workflow Using Microsoft Agent Framework

Artificial Intelligence is now becoming a natural part of our .NET development workflow, and Microsoft just made it even easier with the release of the Microsoft Agent Framework (Preview).

This new framework lets developers build AI-powered systems using multiple agents that can collaborate, reason, and take action, all inside your .NET applications.

In this article, let’s explore what this new framework is all about, understand Agents and Workflows, and finally, build a practical multi-language translator workflow using .NET 9.

What Is Microsoft Agent Framework?

The Microsoft Agent Framework is a new open-source SDK that allows developers to create and orchestrate AI Agents and Workflows directly in .NET or Python.

It combines intelligence and structure in one place, letting you design multi-step AI pipelines that can reason, call APIs, and interact with other agents.

It’s built on top of Microsoft’s earlier projects like Semantic Kernel and AutoGen, but reimagined with better structure, type safety, and scalability.

With this framework, you can:

  • Create Agents that perform specific AI tasks
  • Connect them using Workflows
  • Integrate with tools like Azure OpenAI, GitHub Models, and other APIs
  • Run them locally or in the cloud

In short, it’s Microsoft’s way of bringing agentic AI natively into .NET.

What Are Agents?

An Agent is an AI-powered unit that can perform a specific task, like translating text, summarizing content, or analyzing sentiment.

Each agent has its own:

  • Name (identity)
  • Instructions (what it should do)
  • Model (the brain behind it)

For example, you might have:

  • A Translator Agent that converts text into another language
  • A Reviewer Agent that checks tone and grammar
  • A Summary Agent that creates a report of the final output

Agents can work independently or collaboratively in a workflow.

What Is a Workflow?

A Workflow defines how agents connect and interact with each other.

You can think of it as a flowchart where each agent passes its output to the next one in sequence (or even runs in parallel).

Diagram showing multiple AI agents — French Translator, Spanish Translator, Reviewer, and Summary Agent — connected in a sequential workflow using Microsoft Agent Framework in .NET

Each step executes in order, making the process predictable and structured. That’s exactly what we’re going to build next.

Build AI Agent Workflow

Getting started with the Microsoft Agent Framework is straightforward. In the following example, we’ll build a multi-language translator workflow where multiple AI agents – French, Spanish, Reviewer, and Summary — work together seamlessly inside a .NET application.

Step 1: Project Setup

Let’s start by creating a new .NET 9 console app:

Bash
dotnet new console -n MultiLanguageTranslator
cd MultiLanguageTranslator

Then, install the required NuGet packages:

Bash
dotnet add package Microsoft.Agents.AI --prerelease
dotnet add package Microsoft.Agents.AI.Workflows --prerelease
dotnet add package Microsoft.Extensions.AI.OpenAI

Step 2: Connecting to GitHub Model

We’ll use GitHub’s GPT-4o-mini model for this demo. To access it, you’ll need your GitHub API key.

C#
IChatClient chatClient =
    new ChatClient(
        "gpt-4o-mini",
        new ApiKeyCredential("YOUR_GITHUB_API_KEY"),
        new OpenAIClientOptions
        {
            Endpoint = new Uri("https://models.github.ai/inference")
        })
    .AsIChatClient();

This connects your .NET app to the model and prepares it for our AI agents.

Step 3: Creating the Agents

C#
// French Translator Agent
AIAgent frenchAgent = new ChatClientAgent(
    chatClient,
    new ChatClientAgentOptions
    {
        Name = "FrenchAgent",
        Instructions = "You are a translation assistant that translates the provided text to French."
    });

// Spanish Translator Agent
AIAgent spanishAgent = new ChatClientAgent(
    chatClient,
    new ChatClientAgentOptions
    {
        Name = "SpanishAgent",
        Instructions = "You are a translation assistant that translates the provided text to Spanish."
    });
    
// Quality Reviewer Agent
string qualityReviewerAgentInstructions = """
You are a multilingual translation quality reviewer.
Check the translations for grammar accuracy, tone consistency, and cultural fit
compared to the original English text.

Give a brief summary with a quality rating (Excellent / Good / Needs Review).

Example output:
Quality: Excellent
Feedback: Accurate translation, friendly tone preserved, minor punctuation tweaks only.
""";

AIAgent qualityReviewerAgent = new ChatClientAgent(
    chatClient,
    new ChatClientAgentOptions
    {
        Name = "QualityReviewerAgent",
        Instructions = qualityReviewerAgentInstructions
    });
    
// Summary Agent
string summaryAgentInstructions = """
You are a localization summary assistant.
Summarize the translation results below.
For each language, list:
- Translation quality
- Tone feedback
- Any corrections made

Then, provide an overall summary in 3–5 lines.

Example output:
=== Localization Summary ===
French: Excellent (minor punctuation fixes)
Spanish: Good (tone consistent)
All translations reviewed successfully.
""";

AIAgent summaryAgent = new ChatClientAgent(
    chatClient,
    new ChatClientAgentOptions
    {
        Name = "SummaryAgent",
        Instructions = summaryAgentInstructions
    });
    

Step 4: Connecting Agents with a Workflow

Now that we have all our agents ready, let’s connect them in order:

C#
AIAgent workflowAgent = await AgentWorkflowBuilder
    .BuildSequential(frenchAgent, spanishAgent, qualityReviewerAgent, summaryAgent)
    .AsAgentAsync();

This creates a sequential workflow where each agent runs one after another.

Step 5: Run the Workflow

Let’s take an input from the user and send it through the workflow:

C#
Console.Write("\nYou: ");
string userInput = Console.ReadLine() ?? string.Empty;

AgentRunResponse response = await workflowAgent.RunAsync(userInput);

Console.WriteLine();

foreach (var message in response.Messages)
{
    Console.WriteLine($"{message.AuthorName}: ");
   
    Console.WriteLine(message.Text);
    Console.WriteLine();
}

Now, run the application:

Bash
You: Welcome to our application! Please verify your email before continuing.

And here’s what happens:

  • French Agent → Translates to French
  • Spanish Agent → Translates to Spanish
  • Quality Reviewer Agent → Checks both translations
  • Summary Agent → Produces a final report

Output:

Bash
FrenchAgent: Bienvenue dans notre application ! Veuillez vérifier votre adresse e-mail avant de continuer.

SpanishAgent: 
¡Bienvenido a nuestra aplicación! Por favor, verifica tu correo electrónico antes de continuar.

QualityReviewerAgent:
French: Excellent  tone natural and friendly.
Spanish: Good  slightly formal phrasing.

SummaryAgent:
Both translations reviewed successfully. Ready for publishing.

Each step runs automatically, showing how powerful multi-agent collaboration can be inside .NET.

Summary

The Microsoft Agent Framework brings a structured and extensible way to build AI-driven workflows right inside .NET.

In just a few lines of code, we connected multiple agents, each with its own role, and created a complete translation system that runs sequentially.

This is just the beginning — you can extend this to include more languages, sentiment analysis, or even plug it into APIs for real-world localization projects.

The future of AI + .NET looks exciting — and the Agent Framework makes it simple to get started.

Takeaways

  • Agents are independent AI components that perform specific tasks.
  • Workflows define how agents connect and collaborate.
  • Microsoft Agent Framework lets you orchestrate complex AI pipelines in .NET.
  • Combine them to create intelligent, reusable, and production-ready AI systems.

Walkthrough Video: Build Powerful AI Agents Workflow in .NET | Microsoft Agent Framework

Found this article useful? Share it with your network and spark a conversation.