Domain 4 · Lesson 3 · Prompt Engineering (20%)

Batch Processing & Multi-Pass Review

Task Statements 4.5 & 4.6 — the Message Batches API, and review architectures that scale.

Course progress: Domain 4 ▸ lesson 3 of ~3

Message Batches API (4.5)

PropertyDetail
Cost~50% cheaper than synchronous
LatencyUp to 24-hour window, no guaranteed SLA
Tool callingNo multi-turn tool calling within a single request
Correlationcustom_id matches each request to its response
The fit test Batch is right for non-blocking, latency-tolerant work: overnight reports, weekly audits, nightly test generation. It's wrong for blocking workflows — a pre-merge check where a developer is waiting cannot depend on "up to 24h, no SLA." Mixed workloads → batch the overnight job, keep synchronous for the blocking check.
Distractor watch "Switch both workflows to batch for the savings" is wrong when one is a blocking pre-merge check. "Batch results have ordering problems" is a misconception — custom_id correlates them. "Timeout fallback to real-time" adds needless complexity vs simply matching each API to its use case.
⚠ Accuracy note — exam guide vs current product (2026) The Exam Guide (v0.1, Feb 2025) states the batch API does not support multi-turn tool calling within a single request, and the mock questions follow that. On the exam, answer per the guide. However, the current Message Batches API docs (2026) show that server tools and multi-turn tool loops do now run inside batch requests (the batch worker runs the same server-side agentic loop; a long turn returns pause_turn to continue). The product moved on after the exam was written. The latency/SLA reasoning is unchanged and is what the exam actually tests: batch is asynchronous (most finish <1h, hard cap 24h, no SLA), so it's still wrong for blocking pre-merge checks.

Multi-instance & multi-pass review (4.6)

The recurring myth A bigger context window does not fix attention dilution. More room ≠ more attention quality. The fix is structural: split the passes.

Check yourself

Two workflows: a blocking pre-merge check (developer waits) and an overnight tech-debt report. A manager wants both on the Batches API for 50% savings. Best evaluation:
Correct: option 2. Batch (up to 24h, no SLA) suits the overnight job, not a blocking check. Polling doesn't make batch acceptable for blocking work; ordering is solved by custom_id; the fallback adds needless complexity.
A 14-file PR reviewed in one pass yields uneven depth and contradictory findings. The best restructure:
Correct: option 3. The cause is attention dilution; split into focused passes. A bigger window doesn't improve attention quality; shifting to developers doesn't fix the system; consensus voting suppresses intermittently-caught real bugs.
Decision rules Latency-tolerant / overnight → batch (50% off, custom_id, no SLA, no multi-turn tools). Blocking / pre-merge → synchronous. Batch failures → resubmit by custom_id, chunk oversized. Objective review → independent instance. Big review → per-file + integration passes (window size irrelevant).
Ask your teacher. Ready for the Domain 4 quiz. Ask if the SLA-window math is unclear.