liveBook · Manning

Chapter 3: Errand: Breaking complex workflows into units

What you will learn in chapter 3 of Agent Design Patterns

This introduction frames Errand as a pattern for decomposing complex agent workflows into small intelligent pipelines that control context, improve maintainability, and enable parallel execution.

After this chapter you will be able to

What it builds on

Section by section

Introduction

This introduction frames Errand as a pattern for decomposing complex agent workflows into small intelligent pipelines that control context, improve maintainability, and enable parallel execution.

Key terms: Errand pattern, errands, intelligent subroutine, preset processes, reason-and-act loop, effective perceptive window, maximum context length, hallucinate, linear pipeline, parallelization

3.1 The pain point: Limits on context length

This section explains why agent tasks must be decomposed into a hierarchy of controllable components and defines errands as the leaf routines in that hierarchy.

Key terms: perceptive window, decomposition, target task, flow-controlling components, action-performing components, hierarchy of components, leaf, errands, unidirectional information flow

3.2 How the Errand pattern works

This section defines the Errand pattern as a small, self-contained workflow that combines intelligent entities and procedures to perform one narrow task and return only a final result.

Key terms: Errand, intelligent entity, IE, procedure, parallel-then-sequential arrangement, unifunctionality, unidirectionality, discarding of intermediate results, functional purity, side effects

3.2.1 Tradeoffs

This subsection weighs Errand decomposition’s gains in capability, robustness, and reliability against its added context-sharing cost, including caching as a mitigation.

Key terms: decomposition, agentic logic, errands, unifunctional focus, perceptive windows, capability, overhead, shared context, model calls, decomposing

3.2.2 When and where to use Errand

This section positions Errand as an intelligent subroutine and identifies common enterprise uses for it in AI-powered workflows.

Key terms: Errand pattern, independent intelligent operation, intelligent subroutines, agentic workflow, formatting, classification and tagging, assessment and judging, information extraction, controlled generation, binary pass/fail verdict

3.3 Errand pattern variants

3.3.1 Persona errands

This subsection presents persona errands, which use a fixed system instruction to guide an errand whose specific task arrives later as payload.

Key terms: persona errand, IE, system instruction, payload, agentic characterization, post-training, developer instructions, prompt injection, workflow control, safety and security

3.3.2 Reflection errands

Reflection errands have a model review an earlier intelligent element’s task and result so the workflow can detect or correct hallucinations instead of accepting outputs unchecked.

Key terms: reflection errand, intelligent element, hallucinate, agency, pass/fail, feedback, confidence score, Resampler, Voter, Refiner

3.3.3 Compaction errands

Compaction errands keep an agent operating within an information element’s effective perceptive window by reducing near-limit information into a usable condensed representation.

Key terms: effective perceptive window, information elements, IEs, context length, compaction errand, filtered, summarized, distilled, context embedding, codesigned

3.3.4 Structured extraction errands

This section introduces structured extraction errands, which use controlled generation to turn unstructured inputs into machine-parseable formats such as JSON while keeping that constrained task separate from general reasoning.

Key terms: structured extraction errand, unstructured information, structured output, compatible AI model, AI model endpoint, controlled generation, formal grammar, formatting specification, JSON/YAML/CSV grammars, JSON/XML schemas

3.3.5 Editing errands

This section explains editing errands as focused, reusable post-drafting steps that improve output through disentangled and chainable edits.

Key terms: editing errands, agentic drafting, requirement disentanglement, processing efficiency, editing, autoregressive models, diffusion models, decorator-style chaining, candidate output, editing pipeline

3.4 Applying the Errand pattern: Use-case examples

This section introduces specialized Errand examples that extend common variants and supply multimodal information to an agent’s core logic.

Key terms: errands, specialized errands, user-facing agents, multiple modalities, core logic, information

3.4.1 Speaker stance identification errand

This subsection illustrates an Errand that classifies a named speaker’s stance from a conversation transcript through staged model calls and label extraction.

Key terms: speaker stance identification errand, stance classification, transcript, classification label, AFD

3.4.2 Call summarization errand

This subsection illustrates a multimodal Errand that transcribes a voice call, summarizes its transcript, and procedurally extracts the summary from the model's reasoning trace.

Key terms: multimodal errand, voice call summarization, speech-to-text model, LM, procedural extraction, summarization reasoning trace

3.5 Summary

This summary defines the Errand pattern as a small, one-way intelligent subroutine and recaps how its modular properties make complex agent workflows more reliable and maintainable.

Where this is used later

Concepts explained in this chapter

← Chapter 2: Working with ADPs: Building a mortgage advisor tool Chapter 4: Guardrail: A gating mechanism to boost reliability →

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.