Patterns¶
Pattern creation defines the internal workflow structure that determines how a Unitt executes its objectives. Patterns describe the ordered, parallel, conditional, or iterative steps the runtime should follow when coordinating skills, tools, connectors, policies, and governance checks during execution. Each pattern acts as a reusable execution model that translates a high-level objective into a structured runtime workflow.
Patterns are informed by the active workflow-pattern research lineage, including Anthropic Building Effective Agents (December 2024) which defines the canonical six-pattern taxonomy still dominant in 2026, LangGraph state graphs with Send / Command primitives, AutoGen v0.4 / AG2 GroupChat, CrewAI Processes, LlamaIndex Workflows event-driven steps, Self-Refine (Madaan et al., NeurIPS 2023), and the workflow optimization survey on natural-language-to-DSL graph synthesis. Selection criteria for picking a pattern for a given objective are documented in Reference › Research › Assembly Patterns.
The Six Canonical Patterns¶
Anthropic's December 2024 taxonomy distinguishes workflows ("systems where LLMs and tools are orchestrated through predefined code paths") from agents ("systems where LLMs dynamically direct their own processes") and names six canonical patterns; the platform supports all six and composes them inside a single Unitt as needed.
flowchart LR
P1[Prompt Chaining] --> P2[Routing]
P2 --> P3[Parallelization]
P3 --> P4[Orchestrator-Workers]
P4 --> P5[Evaluator-Optimizer]
P5 --> P6[Autonomous Agent]
classDef stage fill:#ffd541,stroke:#222021,color:#222021
class P1,P2,P3,P4,P5,P6 stage
Prompt Chaining¶
A fixed sequence of LLM calls where each call processes the prior output. Lowest variance, most predictable cost; the right choice when the task decomposes into validatable steps with deterministic gates between each.
flowchart LR
S[Start] --> St1[Step 1]
St1 --> G1{Gate}
G1 -->|pass| St2[Step 2]
G1 -->|fail| ESC[Escalate]
St2 --> St3[Step 3]
St3 --> E[End]
classDef stage fill:#ffd541,stroke:#222021,color:#222021
class S,St1,G1,St2,St3,E,ESC stage
Routing¶
A classifier LLM dispatches input to one of N specialized handlers. The right choice when input has clear categorical structure and per-class specialization recoups classifier overhead.
flowchart LR
S[Start] --> C[Classifier]
C -->|class A| HA[Handler A]
C -->|class B| HB[Handler B]
C -->|class C| HC[Handler C]
HA --> E[End]
HB --> E
HC --> E
classDef stage fill:#ffd541,stroke:#222021,color:#222021
class S,C,HA,HB,HC,E stage
Parallelization¶
Independent subtasks run concurrently. Two flavors: sectioning (different slices of work in parallel) and voting (N runs of the same task aggregated for confidence). Sectioning is the right choice for independent subtasks; voting is the right choice for confidence-critical decisions.
flowchart LR
S[Start] --> SP[Split / Fork]
SP --> W1[Worker 1]
SP --> W2[Worker 2]
SP --> W3[Worker 3]
W1 --> AG[Aggregate]
W2 --> AG
W3 --> AG
AG --> E[End]
classDef stage fill:#ffd541,stroke:#222021,color:#222021
class S,SP,W1,W2,W3,AG,E stage
Orchestrator-Workers¶
A central LLM dynamically decomposes the objective and delegates to workers. The right choice when the subtask count and shape are not known at plan time. The Anthropic multi-agent research system uses this pattern with measured 90.2% lift over single-agent Opus.
flowchart TD
S[Start] --> O[Orchestrator]
O -. dynamic .-> WA[Worker A]
O -. dynamic .-> WB[Worker B]
O -. dynamic .-> WC[Worker C]
WA --> SYN[Synthesize]
WB --> SYN
WC --> SYN
SYN --> O
O --> E[End]
classDef stage fill:#ffd541,stroke:#222021,color:#222021
class S,O,WA,WB,WC,SYN,E stage
Evaluator-Optimizer¶
A generator LLM produces output; a critic LLM evaluates; the loop iterates until the critic accepts or a budget is exhausted. The right choice when clear evaluation criteria exist and iteration measurably improves quality. Self-Refine is the canonical instance; AWS Prescriptive Guidance formalizes the "evaluator reflect-refine loop" with explicit retry-limit termination.
flowchart LR
S[Start] --> G[Generator]
G --> EV[Evaluator]
EV -->|reject| G
EV -->|accept| E[End]
classDef stage fill:#ffd541,stroke:#222021,color:#222021
class S,G,EV,E stage
Autonomous Agent¶
An agent plans and acts open-endedly using tools until a stop condition is met. The right choice for open-ended exploration with strong sandboxing; Anthropic's guidance explicitly warns about higher cost and compounding error.
Pattern Composition¶
Real systems compose patterns. An outer orchestrator-workers loop whose orchestrator uses routing to pick worker pools, with each worker being a prompt chain terminating in an evaluator-optimizer loop, is a common shape. Both LangGraph subgraphs and LlamaIndex nested Workflows make composition first-class.
flowchart LR
OBJ[Objective] --> ORCH[Orchestrator]
ORCH -. routes .-> WPA[Worker Pool A]
ORCH -. routes .-> WPB[Worker Pool B]
WPA --> CH[Prompt Chain]
CH --> EO[Evaluator-Optimizer]
EO --> ORCH
ORCH --> OUT[Outcome]
classDef stage fill:#ffd541,stroke:#222021,color:#222021
class OBJ,ORCH,WPA,WPB,CH,EO,OUT stage
Workflow Graph¶
Each pattern produces a workflow graph that shows how internal workflow steps connect, depend on one another, and move toward completion of the objective. The workflow graph is generated through the workflow engine creation interface, based on the web-text pattern builder description provided by the user. This allows the user to describe the intended workflow in plain language while the platform converts that description into a structured execution graph that can be validated, edited, simulated, and used by the runtime.
Modern workflow-graph synthesis research (AutoFlow, RobustFlow, ComfyUI-R1, 2025) converts natural-language workflow specs into executable DSL graphs and scores them for executability and semantic robustness. The platform pairs synthesis with deterministic export; LangGraph compiled graphs expose graph.get_graph().draw_mermaid() and .draw_mermaid_png(); so the user can edit the visual graph directly when synthesis misses.
flowchart TD
A[Start Objective]
A --> B[Research Company Website]
B --> C[Build Data Profile]
C --> D[Create Business Summary]
D --> E[Research Nearest Competitors]
E --> F[Compile Competitor List]
F --> G[Validate Competitor Pricing]
G --> H[Analyze Results]
H --> I[Generate Draft Email]
I --> J{Human Approval Required?}
J -->|Approved| K[Send Final Email]
J -->|Rejected| L[Return For Revision]
K --> M[Complete Objective]
L --> I
Conditional Branching And Parallel Execution¶
Branching and parallel execution are first-class operations on the workflow graph. LangGraph implements branching via add_conditional_edges(source, router_fn, [destinations]) and dynamic fan-out via the Send API (Send("worker", {"item": x}) for N parallel invocations with per-item state and reducers merging results). LlamaIndex Workflows branches naturally by having a step emit one of several Event subclasses, with ctx.send_event plus ctx.collect_events implementing gather-style joins.
Human-In-The-Loop Within The Pattern¶
Approval and review gates inside a workflow are configured declaratively. LangGraph supports interrupt_before=[node] / interrupt_after=[node] at compile time plus the runtime interrupt() function inside a node that pauses against a checkpointer. OpenAI Agents SDK marks tools with needs_approval=True. Confidence-threshold escalation routes below-τ outputs to a human queue with full reasoning attached, rather than retrying silently.
Pattern Validation¶
Before a Unitt can run its pattern, the workflow graph passes an explicit validation pipeline. The pipeline enforces structural integrity, schema validity at every edge, policy reachability, and dry-run simulation against the configured connectors and tools.
flowchart LR
GRAPH[Workflow Graph] --> STR[Structural Lint]
STR --> SCH[Edge Schema Validation]
SCH --> POL[Policy Reachability]
POL --> DRY[Dry-Run Simulation]
DRY --> REG[Regression Replay]
REG --> REP[Validation Report]
REP -->|pass| READY[Pattern Ready]
REP -->|fail| FIX[Return To Builder]
classDef stage fill:#ffd541,stroke:#222021,color:#222021
class GRAPH,STR,SCH,POL,DRY,REG,REP,READY,FIX stage
- Structural lint detects unreachable nodes, dangling edges, missing terminals, and cycles without exit conditions.
- Edge schema validation confirms typed payloads conform to the declared schema between every step.
- Policy reachability evaluates that the graph passes the Core policy gates at every authorized step.
- Dry-run simulation executes the graph against stubbed tools to surface argument-synthesis and tool-selection issues.
- Regression replay runs recorded production traces through the candidate graph and gates on regression delta plus cost-delta (Braintrust / Langfuse / Phoenix pattern).
Selection Heuristic¶
| Problem Class | Pattern | Cost | Latency | Debuggability | Reliability |
|---|---|---|---|---|---|
| Fixed multi-step transform | Prompt chaining | Low | Med (serial) | High | High |
| Categorical input dispatch | Routing | Low | Low | High | High (with accurate classifier) |
| Independent subtasks | Parallelization (sectioning) | Med | Low | Med | High |
| Confidence-critical decision | Parallelization (voting) | High | Low | Med | Very High |
| Unknown decomposition | Orchestrator-Workers | High | Med | Low | Medium |
| Iterative quality target | Evaluator-Optimizer | High | High | Med | High |
| Open-ended exploration | Autonomous agent | Very High | High | Low | Low (needs sandbox) |
| Sensitive action | Any + HITL gate | + Human cost | + Wait time | High | Very High |
Cross-References¶
- Core supplies the policies and governance the pattern must satisfy at every gate.
- Objectives is the goal the pattern is built to satisfy.
- Skills, Tools, Connectors are the executable substrates the pattern coordinates.
- Emergence › System is the reasoning loop each pattern step delegates to.
- Fabric › Flow extends the single-Unitt pattern into a coordinated multi-agent flow.
- Reference › Research › Assembly Patterns documents citations and selection criteria.