← GUIDES

GUIDE / SETUP NOTE

Agentic Workflows: Five Patterns You Can Run Locally

Five agentic workflow patterns run on a small local model: chaining, routing, voting, orchestrator-workers and an evaluator loop, plus where each slipped.

27 Nov 2026Checked 2026-10-30
Five agentic workflow patterns run on qwen2.5:3b through Ollama: chaining and voting went as asked, while routing invented a product feature, orchestrator-workers broke the bullet limit and the model evaluator gave a wrong PASS

Anthropic's Building effective agents (published Dec 19, 2024), read on 2026-10-30, plus one local run of all five workflow patterns in standard-library Python against Ollama 0.40.13 and qwen2.5:3b. No key, no hosted account.

An agentic workflow is a fixed path through a few model calls. Your code decides the steps; the model fills them in. Anthropic's "Building effective agents" names five such patterns. We ran all five on a 3-billion-parameter model on our own machine, in plain Python with no framework, and wrote down where each one slipped.

The model drafts and classifies. A person reads the final output before it goes anywhere.

Based on Building effective agents, by Erik S. and Barry Zhang at Anthropic. Local runs used Ollama, by the Ollama contributors.

Workflow or agent?

The article draws the line like this: "Workflows are systems where LLMs and tools are orchestrated through predefined code paths. Agents, on the other hand, are systems where LLMs dynamically direct their own processes and tool usage."

Its advice is to start small: "we recommend finding the simplest solution possible, and only increasing complexity when needed. This might mean not building agentic systems at all."

The page now opens with a note: "Much of the tooling landscape described in this post has changed since December 2024." The five patterns below do not depend on any tool, which is why we tested them with nothing but the standard library.

How we tested (2026-10-30)

  • Ollama 0.40.13 on the local machine, model qwen2.5:3b, temperature 0 (the voting step used 0.8 so the three answers could differ).
  • One Python file per pattern, calling Ollama's /api/chat with urllib. No framework, no key.
  • One run each. A bigger model would behave differently, so treat the misses below as examples of what to check, not as scores.

The qwen2.5:3b weights are under the "Qwen RESEARCH LICENSE AGREEMENT", for non-commercial use only; check the model card before any commercial use.

The five patterns

PatternWhat the article saysOur taskCallsWhat happened
Prompt chainingEach call "processes the output of the previous one", with programmatic checks ("gate") between stepsRelease note from a changelog, then a Spanish translation2Code gate (60 words or fewer, mentions CSV) passed; translation done
Routing"classifies an input and directs it to a specialized followup task"Three support messages sorted into billing, bug or other6All three sorted correctly. The "other" reply claimed the product "supports dark mode", which nothing in the prompt said
Parallelization (voting)"Running the same task multiple times to get diverse outputs"Is this message a refund request? Three votes33 of 3 said no, which was right
Orchestrator-workers"a central LLM dynamically breaks down tasks, delegates them to worker LLMs, and synthesizes their results"Checklist for letting an agent edit a git repo5Asked for at most 6 bullets, got 7. One bullet suggested granting the agent admin permission
Evaluator-optimizer"one LLM call generates a response while another provides evaluation and feedback in a loop"One sentence that must contain the word "approve"4The model evaluator said PASS on a draft that used "approval" instead. Our code check caught it; round 2 passed both

What the run showed

  • Put a code check on anything you can check with code. Word counts, required words and bullet limits are cheap to test in Python. In our run the model evaluator missed a rule that a one-line string check caught.
  • A router fixes the path, not the facts. Routing sent each message to the right prompt, and the "other" prompt still invented a product feature. Anything a customer would read needs a person or a source to check it.
  • Orchestrators drift from limits. The synthesis step ignored the bullet limit and added an admin-permission suggestion. Read the merged output before anyone acts on it, especially when it talks about permissions.
  • Voting is cheap insurance on yes/no calls. Three short calls agreed in under a second here. When votes split, send the case to a person rather than picking the majority.
  • Cap every loop. The evaluator loop had a three-round limit. The article lists "stopping conditions (such as a maximum number of iterations)" as a way to keep control of agents, and the same applies to any loop you write.

Which one to start with

Start with prompt chaining and a code gate between steps. Add routing when inputs fall into clear groups. Reach for orchestrator-workers or an evaluator loop only when a fixed chain cannot cover the task, and keep a person on the final output either way.

Takeaway

Agentic workflows are just code paths with model calls in them. On a small local model, all five patterns ran, and the misses were the kind a code check or a person catches: an invented feature, a broken limit, a wrong PASS. Put those checks in from the first version.

Next step: take one task you hand to an agent today, write it as a two-step chain with a code check in the middle, and compare the output.

How we check the tools we list is on our verification page.

Good setups, worth keeping. Request email updates on the home page, then confirm by email. No subscription starts until you confirm. Or find an agent for the job.

Your privacy choices

Choose optional tools. Rejecting them keeps the setup library available. Advertising consent stays off.

Choices stay in this browser for 90 days. You can change them using Privacy settings. Privacy and cookie details