Files
papers/hanzo-flow/sections/05-workflow-patterns.tex

49 lines
1.7 KiB
TeX

\section{Workflow Patterns}
\label{sec:patterns}
We identify seven canonical workflow patterns that cover 89\% of production workflows:
\subsection{Sequential Chain}
The simplest pattern: a linear sequence of LLM calls, each refining the previous output.
\textbf{Example}: Research assistant that (1) generates search queries, (2) retrieves documents, (3) synthesizes an answer, (4) formats the output.
\subsection{Router Pattern}
A classifier node routes input to specialized sub-workflows based on query type.
\textbf{Example}: Customer support that routes to billing, technical, or general sub-agents.
\subsection{Parallel Ensemble}
Multiple models process the same input in parallel; results are merged by a selector.
\textbf{Example}: Code generation with three models, selecting the one that passes unit tests.
\subsection{Iterative Refinement}
A feedback loop where output is evaluated and iteratively improved until quality criteria are met.
\textbf{Example}: Essay writing with LLM-as-judge refinement until score exceeds 8/10.
\subsection{Map-Reduce}
Input is split into parts, each processed independently, then results are aggregated.
\textbf{Example}: Document analysis where each page is summarized independently, then summaries are merged.
\subsection{Human-in-the-Loop}
Automated processing with human approval gates at critical decision points.
\textbf{Example}: Content moderation pipeline with human review for borderline cases.
\subsection{Recursive Decomposition}
Complex tasks are decomposed into subtasks, each handled by a sub-workflow, with results aggregated recursively.
\textbf{Example}: Project planning that breaks a goal into tasks, each task into steps, and each step into actions.