Microsoft Agent Framework: Sequential Flow

 

https://www.pexels.com/photo/domino-blocks-in-a-row-and-human-hand-trying-to-take-one-of-it-9760259/
https://www.pexels.com/photo/domino-blocks-in-a-row-and-human-hand-trying-to-take-one-of-it-9760259/

Building Sequential Workflows with Microsoft Agent Framework

After exploring various workflow patterns in my previous blog posts, I'm excited to share a practical, hands-on example of implementing a sequential workflow using the Microsoft Agent Framework (MAF).

What Are Sequential Workflows?

Sequential workflows are both straightforward and powerful. They enable you to chain multiple executors together, processing data step-by-step in a linear fashion. Each task executes only after the previous one completes, making this pattern ideal for scenarios where:

  • Each step depends on the output of the previous one
  • Processing must follow a specific order
  • Data needs to be transformed through multiple stages

The Example: Fact Retrieval and Summarization

We'll build a sequential workflow that demonstrates a common use case: gathering information and then condensing it for easy consumption. Our workflow will:

  • Fetch facts about a given topic using a specialized fact-retrieval agent
  • Summarize those facts into a concise, digestible format

Let's break down the two executors we'll be using:

1. FactExecutor

Retrieves comprehensive, accurate facts about a specified topic or location.

2. SummarizeExecutor

Condenses the facts provided by the FactExecutor into a brief summary (50 words or less).

Here's how we wire everything together using WorkflowBuilder:

workflow = (
    WorkflowBuilder()
    .add_edge(fact_executor, summarize_executor)
    .set_start_executor(fact_executor)
    .build())

Demo

Check out the complete implementation: https://github.com/dennisseah/maf-workflow/blob/main/samples/sequential_flow.py

Video Walkthrough (view in fullscreen, no audio)




Comments