Skip to lesson

MicrosoftMicrosoft Certified: Multi-Agent AI Solutions Expert2026-103.2 Optimize prompt and model performance for multi-agent solutions

Shorten the critical path of agent workflows

Completed by the knowledge check

Learning objective

Reduce critical-path duration with safe parallelism and dependency-aware execution.

Core idea

For an architect optimizing a multi-agent solution, the useful latency measure is the time until a valid result is ready. Adding parallel agents helps only when it shortens the dependency chain that determines that result. Fast branches cannot compensate for a required slow branch, and speculative work cannot replace a missing prerequisite.

The critical path is the longest required path through the execution graph. It includes admission waits, model calls, tool execution, retries, validation, and aggregation. Parallelism changes which durations add together; it does not remove the work or its capacity requirements. Start with the dependency graph, then identify which operations can safely overlap.

See 2.4.1 and 2.4.2 for sequential gates and concurrent aggregation. This lesson uses those mechanisms to choose an optimization, rather than rebuilding the orchestration patterns.

How it works

Distinguish independence from different agent names

Two tasks are independent when neither consumes the other’s result and both can operate on the same validated input snapshot. A pricing check and a policy lookup can overlap when they both need only the customer request. A purchase cannot overlap with a required approval, even if a different agent performs each operation.

Draw edges for data dependencies, authorization prerequisites, and ordered side effects. An absent data dependency does not prove safety: two branches might update the same reservation or spend the same budget. Give each branch a separate result and reconcile those results before a consequential action. Do not ask two models to resolve conflicting writes after both writes have happened.

Represent dependencies with add_edge / AddEdge (see 2.4.1) and independent participants with ConcurrentBuilder(participants=[...]) (see 2.4.2).

Put the join at the real dependency

Fan in required results with add_fan_in_edges / AddFanInBarrierEdge (see 2.4.1), then apply the aggregator’s acceptance policy from 2.4.2.

In a dependency-graph scheduling model, place a join where an operation consumes several required results. Removing that join to display the fastest response changes the result contract when both branches are mandatory. However, data dependencies alone do not determine when a particular runtime advances: its synchronization rules can introduce additional waits.

Account for the superstep barrier

Agent Framework workflows execute in supersteps. Each superstep routes pending messages from the preceding step, runs all triggered executors concurrently, and waits for every executor to finish before advancing. Messages emitted during execution are queued for the next superstep.

Consequently, a fast policy lookup cannot release a separate coverage executor while a sibling repair-estimation executor in the same superstep is still running. A local dependency edge does not bypass this synchronization barrier. Include that wait when reconstructing the critical path; the ideal dependency-only schedule can understate elapsed time.

The documented remedy for independent paths is to consolidate sequential steps into one executor. Put policy retrieval and coverage checking inside one executor that runs beside repair estimation. Coverage then follows retrieval inside that executor without waiting for another superstep. The two complete paths still meet at the superstep barrier, and proposal generation still needs both accepted results.

Consolidation removes the superstep wait between retrieval and coverage, but both paths still meet at the barrier.

Consolidation removes the superstep wait between retrieval and coverage, but both paths still meet at the barrierWith a separate coverage executor, policy retrieval and repair estimation both reach the superstep barrier, and coverage checking runs only after it. Consolidated into one executor, coverage checking follows policy retrieval directly, both paths meet at the superstep barrier, and proposal generation follows.Consolidated into one executorSeparate coverage executorinside one executorPolicy retrievalCoverage checkingSuperstep barrierRepair estimationProposal generationPolicy retrievalSuperstep barrierRepair estimationCoverage checking

Consolidation changes the executor boundary, not the authorization requirements. Keep validation and required approvals inside the combined logic, and preserve enough operation-level timing to identify which internal step is slow. Use it when independent paths need to progress without intermediate superstep waits, rather than merging unrelated responsibilities indiscriminately.

Estimate the improvement before scheduling it

Suppose a workflow validates input in 1 second, performs independent pricing and policy work in 4 and 6 seconds, and aggregates in 2 seconds. These are illustrative application measurements, not Microsoft limits. Serial execution takes 13 seconds. With each branch contained in one executor and both admitted immediately, parallel execution takes 9 seconds: 1 plus the slower branch’s 6 plus 2.

The 4-second branch still consumes resources. If both branches contend for one deployment and the policy branch waits 5 seconds for admission, the predicted gain disappears. Account for queueing and retries in branch duration rather than treating model inference as the whole path.

Use the same calculation to prioritize work. Removing 1 second from the pricing branch does not reduce the 9-second path while policy remains slower. Improving policy execution or aggregation does. Once the two branches have similar durations, either can become critical on an individual request, so inspect a distribution rather than one average trace.

Bound overlap and verify the result

Bound shared-deployment concurrency with the admission design in 2.4.9; a process-local semaphore is not a deployment-wide rate limit.

Reduce fan-out when the added overlap increases capacity pressure. See 3.2.2 for model throughput and retry behavior. Avoid letting each branch invent a fresh deadline: admission, execution, and aggregation all spend the request’s remaining time.

Agent Framework’s Python workflow telemetry includes workflow.run, executor.process {executor_id}, edge_group.process {edge_group_type}, and message.send. Use executor and message timing to reconstruct the actual dependency path. Record application admission waits alongside it, so waiting before a model call is not mistaken for slow inference. See 3.1.7 for broader failure attribution.

Compare end-to-end latency and valid completion rate under representative load. A faster median with more deadline failures is not sufficient evidence that the change improves the solution.

Key distinctions and trade-offs

The following choices affect different parts of the path:

ChoiceWhat it changesWhat it must preserve
Parallel independent branchesOverlap of workInput snapshot, capacity budget, separate results
Dependency joinsWhich results a consumer requiresRequired predecessors and runtime barriers
Faster critical executorDuration of the longest pathResult quality and validation
Optional branch exclusionWork required for completionAn explicitly changed result contract

Parallelism trades elapsed time for overlapping demand. Dependency-aware execution must account for both required inputs and the runtime’s superstep barriers, while bounded admission protects the shared deployment. Neither authorizes speculative side effects or incomplete answers.

Architecture / decision scenario

A claims assistant validates a claim, retrieves policy terms, estimates repair costs, checks coverage against those terms, and produces a settlement proposal. Payment requires a separate approval. The team initially executes every stage serially.

Policy retrieval and repair estimation use the same validated claim and do not write shared business records, so the team runs them concurrently. A separate coverage executor chained after retrieval waits for repair estimation to finish because both initial executors occupy the same superstep. The team consolidates retrieval and coverage into one executor running beside estimation, allowing those internal steps to proceed sequentially within that superstep. Proposal generation joins the accepted coverage result and estimate after the barrier. Approval remains before payment because it is an authorization dependency.

Workflow spans show repair estimation is slower than coverage. The team first optimizes estimation rather than adding more policy agents. Under load, extra estimates produce admission waits, so the team caps shared concurrency and includes those waits in the path calculation. It compares valid proposal latency before and after the change. If estimation times out, the aggregator follows the explicit incomplete-result policy; it does not treat coverage alone as a complete settlement proposal.

Common exam traps

  • Assuming different agents imply independent tasks.
  • Summing all parallel durations instead of following the longest required path.
  • Optimizing a fast branch while the slow required branch is unchanged.
  • Assuming a chained branch advances while a sibling executor in the same superstep is still running.
  • Removing an approval or validation dependency to make a trace shorter.
  • Treating a local semaphore as a deployment-wide rate limiter.
  • Measuring model duration while omitting admission, retries, and aggregation.

What to remember

Parallelize ready, independent work and preserve data, authorization, and side-effect ordering. Place joins where results are needed and include superstep barriers in the schedule. Measure the actual critical path under load; bounded overlap is useful only when the valid end-to-end result arrives sooner.

Knowledge check

References