6 patterns

Workflows

The code fixes the path; the LLMs fill in each step.

Patterns in Workflows

Prompt Chaining

Workflows · 6 nodes · 3 LLM calls · branch · 2 scenarios

+2 variants · Schluntz & Zhang 2024

Break a task into fixed steps, where each LLM call works on the previous output, with optional code checks between steps.

Routing

Workflows · 6 nodes · 2 LLM calls · branch · 2 scenarios

+2 variants · Schluntz & Zhang 2024

Classify the input, then send it to a specialized prompt, model or tool.

Parallelization: Sectioning

Workflows · 7 nodes · 3 LLM calls · parallel · 1 scenario

+2 variants · Schluntz & Zhang 2024

Split the work into independent subtasks, run them in parallel, then merge the results.

Parallelization: Voting

Workflows · 6 nodes · 3 LLM calls · parallel · 1 scenario

+2 variants · Wang et al. 2022

Run the same task N times, or with N different prompts, and take the majority or consensus answer.

Orchestrator-Workers

Workflows · 6 nodes · 5 LLM calls · parallel · 1 scenario

+1 variant · Schluntz & Zhang 2024

A central LLM works out the subtasks at run time, sends them to worker LLMs, then combines the results.

Evaluator-Optimizer

Workflows · 4 nodes · 6 LLM calls · loop · branch · 2 scenarios

+2 variants · Schluntz & Zhang 2024

One model drafts, another judges; the loop runs until the work clears the bar.