Design workflows, tool-augmented flows, and multistep reasoning pipelines
AI-103 › Unit 2: Implement generative AI and agentic solutions › Build generative applications by using Foundry › Design workflows, tool-augmented flows, and multistep reasoning pipelines
Design workflows, tool-augmented flows, and multistep reasoning pipelines
A single model call answers a question. A workflow completes a task — several steps, several participants, sometimes a human, and state that survives between them. Agent Framework gives five orchestration patterns plus the machinery that makes long-running work durable, and the exam tests whether you can pick the pattern from the shape of the problem.
Why This Matters
The patterns differ in who decides what happens next. That single question separates all five. Get it wrong and you either over-constrain a genuinely open-ended task or leave a regulated flow with no checkpoint.
Durability is a design property, not an afterthought. Work that pauses for a human, or runs for hours, needs checkpoints — "save and restore workflow progress" — or a restart loses everything.
Composition goes both ways. You can put agents in workflows and expose workflows as agents. That symmetry is what lets a complex pipeline be consumed as a single callable participant.
Prerequisites
- What an agent is, and that agents choose tools autonomously.
- Function calling: the model proposes a call, your code or the service executes it.
- That approvals pause a run before invocation.
- Basic idea of shared state between steps.
Learning Objectives
By the end of this lesson you will be able to:
- Select among the five orchestration patterns from a described problem.
- Design a tool-augmented flow and place approvals in it.
- Apply checkpoints, human-in-the-loop, and state management correctly.
- Compose agents in workflows and workflows as agents.
- Recognise when a declarative workflow is the right expression.
Building Blocks
The five orchestrations.
| Pattern | Who decides the next step | Fits |
|---|---|---|
| Sequential | Fixed at design time | A known pipeline: extract → validate → summarise |
| Concurrent | Fixed; all run together | Independent work fanned out, results merged |
| Handoff | The current agent, transferring control directly | Triage into specialists |
| Group chat | An orchestrator chooses who speaks | Collaboration with a single observable decision point |
| Magentic | A manager plans and replans | Open-ended problems where the plan is not known in advance |
Executors and state. A workflow is composed of executors with state management — "sharing data across executors" — so a later step can read what an earlier one produced without threading everything through return values.
Human-in-the-loop. Described as "pause for external input and resume". The run stops, surfaces what it needs, and continues when the input arrives.
Checkpoints. "Save and restore workflow progress", so a paused or interrupted run is durable state rather than a process held open in memory.
Composition. Agents in workflows — an agent is a participant in a larger flow. Workflows as agents — a whole workflow is exposed as a single agent that something else can call. Declarative workflows express the structure as configuration rather than code.
Tool-augmented flow. Built-in tools include Web search, Code Interpreter, Custom Code Interpreter (preview), File Search, Azure AI Search, Azure Functions, Function calling, Image Generation (preview), Browser Automation (preview), Computer Use (preview), Microsoft Fabric (preview), and SharePoint (preview). Memory and web search are in preview. Custom tools cover MCP, OpenAPI, A2A (preview), and Toolbox.
Handoff against group chat
| Attribute | ||
|---|---|---|
| Control transfer | Directly between agents | Through an orchestrator |
| Decision point | Distributed | Single and observable |
| Fits | Triage to a specialist who then owns it | Several agents contributing to one problem |
| Governance | Harder to evidence | Easier to enforce policy |
Deep Dive
Choosing the pattern
Start from what is known at design time.
If the steps and their order are fixed, the answer is sequential; if they are fixed and independent, concurrent. These are the most constrained patterns, and constraint is a virtue — a fixed path is trivially auditable and cannot loop.
If the routing depends on the input but the destinations are known, you are choosing between handoff and group chat, and the discriminator is where control goes. Handoff transfers control directly: a triage agent identifies a billing question and hands the conversation to the billing specialist, which then owns it. Group chat keeps an orchestrator in the loop deciding who speaks next, so several agents can contribute and one component sees every turn.
That difference is a governance decision as much as a design one. A regulated flow benefits from group chat's single decision point, because policy can be applied and observed in one place; a handoff network distributes that authority across the agents themselves.
If the plan itself is unknown — the task is open-ended and the steps must be discovered — the answer is Magentic, where a manager plans, delegates, observes, and replans. It is the most capable and the least predictable, which means it needs the most instrumentation: traces, agent evaluators, and approvals on anything consequential.
Designing a workflow
Ask what is known at design time
Fixed order → sequential. Fixed and independent → concurrent.
Making long-running work durable
A workflow that waits for a person can wait for hours. Two mechanisms make that safe.
Human-in-the-loop is the pause: the run stops, surfaces what it needs — an approval, a missing value, a decision — and resumes when it arrives.
Checkpoints make the pause durable. Because progress is saved and restorable, a wait is persisted state rather than a live process, so a restart, a deployment, or an outage does not discard hours of work. Any scenario mentioning a long wait, an overnight approval, or resilience across restarts is pointing at checkpoints.
State management is the third piece and solves a different problem: sharing data across executors so step five can use what step two computed. Without it, workflows degenerate into passing ever-larger blobs down the chain.
Tool-augmented flows and where approval sits
A tool-augmented flow is an agent with tools inside a larger structure, and the design question is which tools and where the gates are.
The built-in set spans search and knowledge (Web search, File Search, Azure AI Search, SharePoint), execution (Code Interpreter, Custom Code Interpreter, Azure Functions, Function calling), and interaction (Browser Automation, Computer Use, Image Generation). Custom tools add MCP, OpenAPI, A2A, and Toolbox. Several are preview — including memory and web search — which matters when a scenario constrains the design to generally available features.
Approvals belong on the calls whose consequences are hard to reverse: writes to systems of record, financial movement, outbound communication, deletion. Gating everything is the common over-correction, and it degrades into rubber-stamping.
One distinction worth holding: a code model writes code, while Code Interpreter executes it. A requirement to compute an answer from data — analyse a spreadsheet, produce a chart — needs execution, not a better code model.
Composition in both directions
Agents in workflows is the obvious direction: agents are participants, each contributing a capability.
Workflows as agents is the one people forget, and it is what makes systems compose. A five-step document-processing workflow can be exposed as a single agent, so a higher-level orchestration calls it exactly like any other participant, without knowing it is a workflow. Encapsulation of a multistep pipeline behind one interface is the answer whenever a scenario needs an existing pipeline reused inside a larger system.
Declarative workflows express structure as configuration rather than code. That suits flows that must be reviewed, version-controlled, or edited by people who are not writing application code — the same argument that favours declarative infrastructure.
Worked Examples
Example 1 — triage into specialists. A support system classifies an incoming request and passes it to a billing, technical, or account specialist who then owns the conversation.
Handoff — control transfers directly to the specialist, which is exactly the described behaviour. Group chat would keep an orchestrator deciding each turn, which is more machinery than a hand-off-and-own flow needs. Sequential cannot route dynamically.
Example 2 — an overnight approval. A workflow prepares a filing, requires a compliance officer's approval that may take until the next day, then submits.
Human-in-the-loop to "pause for external input and resume", plus checkpoints so progress is saved and restored — the wait is durable state, not a held-open process, and survives restarts and deployments. Approval sits on the submit step, the consequential one.
Example 3 — reusing a pipeline. An existing five-step extraction and validation workflow must become one step inside a larger multi-agent system.
Workflows as agents — expose the whole workflow as a single agent so the outer orchestration calls it like any other participant. Rebuilding its steps as individual participants in the outer flow would duplicate logic and lose the encapsulation.
Visual Explanations
Choosing the pattern:
Durability around a human pause:
Common Mistakes
Choosing Magentic for a complicated but knowable task. It is for unknown plans.
Confusing handoff with group chat. Direct transfer against an orchestrator.
Ignoring the governance side of the choice. Group chat has one observable decision point.
Treating human-in-the-loop as sufficient for a long wait. Checkpoints make it durable.
Threading state through return values. State management shares data across executors.
Forgetting workflows can be exposed as agents. That is how pipelines get reused.
Assuming every tool is generally available. Several are preview, including memory and web search.
Expecting a code model to compute an answer. Code Interpreter executes.
Practice Exercises
- Give the discriminating question for each of the five patterns.
- What is the difference between human-in-the-loop and checkpoints, and why do you usually need both?
- A five-step pipeline must be reused inside a larger system. Which composition, and why not rebuild it?
- When is group chat preferable to handoff for governance reasons?
- Which tools are noted as preview, and why does that matter in a design question?
▶Answers
- Sequential — is the order fixed at design time? Concurrent — are the steps fixed and independent? Handoff — does control transfer directly between agents? Group chat — does an orchestrator decide who speaks? Magentic — is the plan itself unknown in advance?
- Human-in-the-loop is the pause — "pause for external input and resume". Checkpoints "save and restore workflow progress", making that pause durable across restarts and deployments. Together they turn a long wait into persisted state rather than a held-open process.
- Workflows as agents — expose the pipeline as a single agent the outer orchestration calls like any other participant. Rebuilding its steps duplicates logic and discards the encapsulation.
- Because group chat routes every turn through an orchestrator, giving a single observable decision point where policy can be applied and evidenced. Handoff transfers control directly, distributing that authority and leaving no central checkpoint.
- Memory and web search are called out as preview, along with Custom Code Interpreter, Image Generation, Browser Automation, Computer Use, Microsoft Fabric, SharePoint, and A2A among custom tools. It matters because a scenario restricted to generally available capability eliminates them.
Summary & Concept Map
Workflow design starts with one question: who decides what happens next? Fixed at design time gives sequential or concurrent; direct transfer between agents gives handoff; an orchestrator choosing the speaker gives group chat, which is the easier pattern to govern; an unknown plan gives Magentic, the most capable and least predictable. Around whichever you choose, human-in-the-loop pauses for external input and checkpoints make that pause durable, while state management shares data across executors. Compose in both directions — agents in workflows and workflows as agents — and express structure declaratively where it must be reviewed or versioned. Tool-augmented flows draw on a large built-in set, several of which are preview, with approvals placed by consequence.
Sources and freshness
Written against current Microsoft Learn documentation for the AI-103 skills measured (16 April 2026), reviewed 2026-08-20. Microsoft Learn controls every changing product contract — availability, preview status, quotas, limits, regional support, naming, and retirement dates all move independently of this lesson. Where a scenario turns on a specific number or a GA/preview boundary, confirm it against the product's own page before relying on it.