Lesson 1 of 3 Optimizing Duration, Context and Tokens

Reducing Task Duration with Parallelism Within Rate Limits

This lesson explains how to find what determines the duration of a multi-agent workflow and how to reduce it with parallelism, model choice and capacity planning, without running into rate limits.

Learning outcomes

After completing this lesson, you will be able to:

  • Find the critical path of a workflow run.
  • Order the levers that reduce duration by impact.
  • Plan capacity so that parallel calls stay within TPM and RPM limits.

Finding the critical path

A trace of a workflow run shows each agent invocation, model call and tool call with its start time and duration. The critical path is the chain of dependent steps that determines the total duration; steps off the critical path can be slow without affecting the total. Optimization starts with traces from slow runs, comparing the share of time spent in model calls (including time to first token and output generation), tool calls, retrieval and waiting for approval.

The following diagram shows a run's steps with its critical path highlighted.

The critical path of a workflow run. Each bar is a step from a trace, with its start and duration. The critical path is the chain of dependent steps that sets the total duration: here planning, retrieval, drafting and formatting. Steps off the critical path, such as the credit check running in parallel with retrieval, can be slower without changing the total, so optimization starts on the critical path.
Durations are illustrative.
Fill in the number

The critical path

Exam skills 3.2.1

A planner runs for 4 s. Then a search subagent (12 s) and a pricing subagent (5 s) run in parallel. A writer (6 s) needs both results.

Log in to try this activity Interactive activities are free with an account.

Reducing duration

The main levers are listed below, roughly in order of impact.

  • Parallelize independent steps: concurrent subagents, parallel tool calls and parallel retrieval queries.
  • Right-size models: smaller models or lower reasoning effort for simple steps.
  • Shorten prompts and outputs: compaction, trimmed tool results and output limits reduce processing time.
  • Remove steps: replace agent steps that apply fixed rules with code.
  • Stream the final response so users see progress; report intermediate status for long tasks.
  • Start early: begin retrieval or data loading while the planner is still deciding.
Select all that apply

Levers that shorten a run

Exam skills 3.2.1

Pick the changes that reduce how long a multi-agent run takes.

Log in to try this activity Interactive activities are free with an account.

Rate limits and capacity

Each Standard deployment has a tokens-per-minute (TPM) quota and a derived requests-per-minute (RPM) limit. When a workflow's parallel calls exceed them, the service returns HTTP 429, and retries add delay, so excessive parallelism can make runs slower. Capacity options are compared in the following table.

OptionEffect on durationWhen to use
Concurrency cap sized to quotaAvoids 429 retriesAlways, with parallel execution
More quota or Global/Data Zone deploymentsHigher limitsSpiky workloads within regional quota
Several deployments behind APIMSpreads load, fails overLoad beyond one deployment's limit
Provisioned throughputPredictable latency, reserved capacitySteady, high-volume, latency-sensitive workloads
Scenario questions

Capacity choices

Exam skills 3.2.1

Choose the capacity option for each workload.

Log in to try this activity Interactive activities are free with an account.
Worked example

Slower after parallelizing

A team changed a ten-agent analysis from sequential to fully parallel. Average duration fell from 70 to 25 seconds at low load, but at peak it rose to 90 seconds. Traces show many HTTP 429 responses and retries.

Parallel requests exceed the deployment's TPM at peak. A concurrency cap sized to quota, plus additional capacity (more quota, a second deployment behind API Management or provisioned throughput for steady load), keeps parallelism within limits. Returning to sequential execution would give up the low-load gains.

Check yourself

What should be found before optimizing a slow multi-agent run?

Show answer

The critical path, from traces, because speeding up steps that are not on it does not shorten the run.

Exam Tips

Remember for the exam

  • Use traces to find the critical path before optimizing.
  • Parallelism beyond TPM/RPM causes 429s that make runs slower.
  • Steady high volume with predictable latency: provisioned throughput.