When to reach for it
- The input is naturally segmentable and tasks are independent to reduce latency (sectioning).
- Robustness is more important than single execution costs (voting).
Split the work. Run in parallel. Merge the results.
Independent subtasks are processed in parallel and either merged (sectioning) or the best result is selected via an aggregator (voting).
Independent sub-tasks run at once, then combine.
| Branch | Checks | Seconds | Finding |
|---|---|---|---|
| Liability | Clauses 8 to 12 | 14 | No cap on liability |
| Pricing | Annex A | 11 | Price index clause is in order |
| Data protection | Clause 15 and the processing agreement | 16 | List of sub-processors is missing |
| Aggregator | The three findings | 5 | One report with two open points |
import asyncio
async def review(contract):
# sectioning: fixed, different branches
liability, pricing, privacy = await asyncio.gather(
check_liability(contract),
check_pricing(contract),
check_privacy(contract),
)
# the aggregator writes one report
return await merge(liability, pricing, privacy)When to reach for it
When it backfires
The split creates chunks that share implicit context. Workers produce incompatible partial results that can't be merged.
Countermeasure
Validate independence before splitting. If chunks share state, use a pipeline instead of parallelization.
One worker returns a list, another returns a dict. The join step crashes or silently drops data.
Countermeasure
Define a schema contract for every worker output. Reject non-conforming responses before merging.
Next pattern
Search patterns, frameworks, and pages.