AI course

Module 16 of 21 · Part 4: Agentic engineeringBuilders track

What an agent really is

A model, some tools and a loop. Workflows versus agents as Anthropic defines them, the five patterns with business examples, what autonomy costs, and the checklist for deciding whether something needs an agent.

15 min read3 promptsUpdated October 2026

You have spent five modules working with an agent without anyone defining the word. reads files, runs commands, gets things wrong, fixes them and tries again; you watched it do all of that in modules 11 to 15. Part 4 starts by opening that box: what is inside an , how it differs from a workflow, and the question that saves the most money: does this need an agent at all?

The main source is "Building effective agents", Anthropic’s December 2024 post that set the vocabulary most of the industry now uses, checked against the Claude documentation as of October 2026.

What is inside an agent?

Three pieces, and none of them is magic. A model: the from module 1, which only knows how to produce text. Some tools: actions your program (or Anthropic’s server) performs on its behalf, such as searching the web, reading a file, looking up a booking or writing to a spreadsheet. And a loop: the model looks at the goal and what it knows so far, decides the next step, asks for a tool, reads the result and decides again, until it judges the task done or something stops it.

The middle piece is the one people get wrong: the model never executes anything. Anthropic’s documentation describes it as a contract between your application and the model: you describe which tools exist and what inputs they take; the model replies with a structured request in ("check availability for apartment 501 on these dates"), your code runs it and returns the result, and the model carries on with that information. That is . The , and from Part 2 are tools; what changes in Part 4 is that you write the program that wires them in.

The loop has concrete mechanics too. In the , every model response carries a stop reason: if it says "tool use", your program runs what was requested and calls again; if it says "end turn", the model has given its final answer and the loop ends. An agent is, quite literally, a loop of a few lines around that question, plus everything you put around it: a cap on iterations, a log of every step, . Claude Code is exactly that. Its documentation defines it as an agentic coding tool that reads your codebase, edits files and runs commands; when you saw it ask for permission before a command in module 13, you were watching the pause at a tool.

What is the difference between a workflow and an agent?

Anthropic separates two things many people call "an agent". A workflow is a system where the model and tools are orchestrated through predefined code paths: you decided the steps and their order, and the model does its part inside each step. An agent is a system where the model dynamically directs its own process and tool usage: it decides the path. The difference is not how powerful the is or how many tools it has, but who chooses the next step.

Both are built from the same brick, which the post calls the augmented LLM: a model with three additions, retrieval (searching your documents or the web, what module 6 showed you as projects and connectors and the jargon calls ), tools and . Every call inside a workflow or an agent is an augmented LLM doing one concrete job.

Almost everything you built in Part 2 is a workflow. The invoice from module 8 (trigger, AI step, action, human review) is one: nobody decides anything along the way. The that summarizes yesterday’s bookings, too. And that is fine: a workflow is predictable, cheap and easy to test with the module 9 test set.

What are the workflow patterns?

The post describes five patterns. Each solves a different problem, and almost any process in a small business fits one of them, or two combined:

  1. 1Prompt chaining. The task is split into sequential steps and each call works on the previous output, with code checks between steps where needed. Example: draft an apartment description, check with code that it stays under the allowed length, translate it into English.
  2. 2Routing. A first call classifies the input and sends it to a specialized step. Example: a WhatsApp message is sorted into availability request, payment question or complaint, and each type gets its own (the complaint goes to a person). It also works for sending easy questions to a small, fast model and hard ones to a more capable one.
  3. 3Parallelization. Several calls at once. In the sectioning variant, each does an independent part: one checks the tone of a reply while another checks it promises no discounts. In the voting variant, several do the same task and you compare: three reviewers look for errors in a contract, and anything any of them flags gets marked.
  4. 4Orchestrator-workers. A central model breaks the task down, delegates the parts to worker models and synthesizes the results. It differs from parallelization in that the subtasks are not known in advance: the orchestrator defines them case by case. Example: "prepare the launch of this apartment" becomes a listing, a house manual and welcome messages, each handled by a worker.
  5. 5Evaluator-optimizer. One model generates, another evaluates against clear criteria and returns feedback, and the loop repeats. Example: a translation that a second model critiques until it reads naturally. It works when you have written criteria; without them, the evaluator applauds, the you met in module 5.

This course was written with the fourth pattern: one orchestrating session defined the brief, launched several in parallel, each with one module, and then reviewed and assembled the results. The subagent from module 14 is a worker; module 18, on , is this pattern in depth.

Prompt

Map this process to a workflow pattern

When you already know a process is a workflow and want to see it as one of the five patterns before building it.

This is a process in my business I want to automate with AI: [DESCRIBE THE PROCESS IN 3 TO 5 SENTENCES: what comes in, which steps are done today, what goes out and who reviews].

Use the five workflow patterns from Anthropic’s "Building effective agents": prompt chaining, routing, parallelization (sectioning or voting), orchestrator-workers, and evaluator-optimizer.

1. Tell me which pattern (or which combination of two) best describes the process, and why the others fit worse.
2. Draw the flow as a numbered list of boxes. For each box: whether code, a person or the model does it; what goes in and what comes out; and, if it is the model, the fixed instruction in one line.
3. Mark with a code check every point where a rule can verify the output (totals that add up, required fields, maximum length) and with a human checkpoint the step before any irreversible action.
4. End by saying which part of the process the model should not do because a rule or a query to a system does it better.

Note: If it proposes orchestrator-workers for a three-step process that is identical every time, it is overcomplicating: ask for the prompt-chaining version.

When is an autonomous agent justified?

When the steps cannot be known in advance. Anthropic recommends agents for open-ended problems where it is hard to predict how many steps will be needed and a fixed path cannot be hardcoded. Fixing a bug in code is the classic example: nobody knows whether it will touch one file or six, and the agent reads, changes, runs the , sees which one fails and repeats. It works there because code can be verified through tests; even so, the post says, human review remains crucial. Customer support qualifies too: a conversation does not follow a script, it needs external data and actions, and success can be measured.

In exchange, the post is blunt about the price: agentic systems often trade and cost for better task performance, with higher costs and the potential for compounding errors. One by one:

  • Latency. Every turn of the loop is a call to the model. Ten turns are ten waits in a row; a guest on WhatsApp will not sit through that.
  • Cost. Every call resends the accumulated conversation, tool definitions and results already read included; the context grows with every turn, and so do the input .
  • Compounding errors. If the agent misread a figure at step two, steps three to ten are built on that mistake, with the same confident tone you met in module 1.
  • Harder to test. A fixed workflow is tested step by step with the module 9 test set. An agent can take a different path every time; measuring it requires of the whole task, the subject of module 20.

How do I pick the simplest design that works?

The post’s central recommendation fits in one sentence: find the simplest solution possible, and only increase complexity when needed; for many applications, it notes, optimizing a single call with retrieval and in-context examples is enough. In practice it is a ladder with four rungs, climbed one at a time:

  1. 1No AI. If the data already lives in a system and the rule can be written down, an ordinary program is cheaper, faster and never makes things up. Many requests that arrive asking for "an agent" are a database query and a formula.
  2. 2One well-written prompt. With role, context, examples and format (module 4), a single call handles classifying, extracting, drafting and summarizing. If you ran it by hand ten times and it works, you are done.
  3. 3A workflow. When one call is not enough but the steps are known, pick one of the five patterns and put code checks between steps.
  4. 4An agent. Only when the steps depend on what is found along the way, and in an environment where mistakes are cheap or a person sits before anything irreversible.

In the 4D framework this is at its finest grain: not only whether you hand the task to AI, but how much of the decision you hand over.

Does this need an agent? The checklist

Before building, answer these questions in writing, the same ones the prompt below asks you one at a time:

  1. 1Does the data or the decision already exist in a system or a written rule? If yes, it does not need AI: it needs a query or a formula.
  2. 2Does a single call with good context solve the large majority of cases? Run it by hand ten times before designing anything else.
  3. 3Can I write the steps in order, the same for every case? If yes, it is a workflow; pick the pattern.
  4. 4Does the number of steps depend on what is found along the way? Only here does an agent come in.
  5. 5What happens if it gets step three wrong and nobody sees it? If the answer is frightening, the design needs a human checkpoint or code validations, not more autonomy.
  6. 6How will I know it works? If you cannot describe the test (real cases with known answers), you are not ready to build anything.
  7. 7How long can the user wait, and how much can each run cost? A ten-turn agent does not fit inside a WhatsApp conversation or a process that runs a thousand times a day.

Prompt

Does this need an agent?

Before building or commissioning any AI automation, so that the first answer is the simplest design rather than the most impressive one.

I want to solve this task in my business: [DESCRIBE THE TASK IN 3 TO 5 SENTENCES: what comes in, what goes out, who does it today, how many times a day, and what happens if it goes wrong].

Your job is to find the simplest design that solves it, following the principle from Anthropic’s "Building effective agents": the simplest solution possible, and complexity only when needed. Before recommending anything, ask me these questions one at a time and wait for my answer:
1. Does the data or the decision already exist in a system or a written rule?
2. Are the steps the same for every case, or do they depend on what is found?
3. What happens if a step goes wrong and nobody sees it?
4. How long can the person receiving the result wait, and how many times a day does it run?
5. How would we know it works?

With my answers, classify the task into ONE of four levels and defend the choice: (A) no AI needed: a query or a rule; (B) one well-written prompt; (C) a workflow, naming the pattern (prompt chaining, routing, parallelization, orchestrator-workers, evaluator-optimizer); (D) an agent that decides its own steps. Explain why the level below is not enough and what cost the one you recommend brings (latency, cost per run, compounding errors, difficulty of testing). Close with where the human review would go and what the first test would be.

Note: If it recommends (D) straight away, ask it to argue for (B) and (C) as if it were being paid to. One of the two is almost always enough.

Prompt

Take the AI out of this design

When you already have a design (yours, a vendor’s or the previous prompt’s) and want to know which parts are unnecessary before paying for them.

This is the design of an AI automation for my business:

[PASTE THE DESIGN: steps, what the model does in each, tools, where a person reviews]

Act as a skeptical engineer who is paid to reduce complexity. Review it step by step and, for each step where the model is involved, answer: would a rule, a query to a system or an ordinary program do the same thing more reliably? If yes, propose the replacement. If not, explain in one sentence what the model does that code cannot.

Deliver the reduced design in the same format, a list of what you removed and why, and one warning: which piece of data could go stale or which rare case is lost with the simple version.

Note: That last warning is the important one. At 77Rentals, that question ("which data goes stale?") is what ruled out a daily routine and led to a live endpoint.

Try it now · 15 min

Classify one process with the checklist

  1. 1Open your module 8 scoring table (frequency × minutes × risk) and take the highest-scoring process you have not automated yet. If you never built that table, pick a repetitive process and write in five sentences what comes in and what goes out.
  2. 2Write the steps as you would explain them to an intern. Mark each step F if it is always the same or D if it depends on what is found. Count the Ds.
  3. 3Answer the seven checklist questions in writing. Be honest on the first one: does the data already exist in your accounting software, your booking system or your CRM?
  4. 4Run the "Does this need an agent?" prompt with your description and compare its verdict with yours. If it recommends a workflow, run "Map this process to a workflow pattern" and check that every box has its check.
  5. 5Write in your course notebook: the rung you chose (no AI, one prompt, a workflow with its pattern, or an agent), the reason in one line, and what would have to change in the process to justify climbing one rung.

What you should end up with: One real process classified at the simplest design that solves it, with its steps marked as fixed or dependent, and a written reason you can defend to anyone who proposes "an agent for that".

The next module, "Writing tasks for agents", takes the rung you chose and writes its contract: the spec, the acceptance criteria and the tests that tell an agent what finished means. It is what separates a useful agent from one that works for hours in the wrong direction.

Before moving on to module 17

  • I can explain an agent through its three pieces (model, tools, loop) and say why the model never executes anything itself.
  • I can tell a workflow from an agent with a single question: who chooses the next step.
  • I can name the five patterns and give an example from my business for at least three.
  • I have one real process classified on one of the four rungs, with the reason written down.
  • I can name the four costs of autonomy, and I know that at 77Rentals the best design for prices was not to use a model.

Mini quiz

  1. 1. By Anthropic’s definition, which of these systems is an agent?

  2. 2. Every incoming invoice goes through three steps, always the same: extract the data, validate the tax ID, record it in the sheet. Which design fits?

  3. 3. At 77Rentals, the price refresh run by a Claude session was replaced by an endpoint that queries the booking system live. What was the underlying reason?

  4. 4. When does Anthropic recommend an autonomous agent instead of a workflow?

Official resources from Anthropic

Anthropic’s official courses, organized by level and linked to each part of this course.

See all resources