Skip to content
What an agent actually is

01.02 · Concept · Free

Agent or workflow — and why it matters

Decide whether a task needs an agent at all, or a fixed pipeline that is cheaper and testable.

The player loads only when you ask for it, so this page stays fast.

Curated for this lesson1/3

What an agent actually is

Knowing When Not to Use AI: AI Agents vs Rules vs ML

Directly targets the decision: agents, rules, or ML, for beginners choosing the cheapest reliable approach.

Also worth watching

A workflow is the safer default when the steps are known; an agent is justified only when the system must choose its own next action at runtime. The practical decision is about control flow, cost, testability and risk, not whether an LLM is present.

What this lesson answers

  • when should I use an agent instead of workflow
  • difference between AI agent and fixed pipeline
  • how to decide if a task needs agentic behaviour

Notes

A workflow is a fixed process: step A calls a model, step B validates the result, step C writes to a database, and the order is known in advance. An agent is a system that can decide what to do next while it is running: choose tools, inspect results, revise a plan, retry, or stop. The difference is not whether an LLM is involved; both can use LLMs. The difference is who controls the flow: your code, or the model-driven loop.

For a software engineer, think of a workflow like a normal backend job or CI pipeline. It is cheaper to run, easier to test, easier to monitor, and easier to explain when it fails. Use it when the task has stable inputs, known steps, clear success criteria, and limited need for exploration. Examples include summarizing a support ticket into fields, classifying a document, drafting an email from a template, or extracting data with validation.

Use an agent only when the task genuinely needs dynamic decision-making. Good candidates involve uncertainty about which steps are needed, which information sources to inspect, or how many iterations are required. Examples include investigating a production incident across logs and dashboards, researching a question across multiple documents, or using tools to complete an open-ended task. Even then, bound the agent with budgets, permissions, timeouts, allowed tools, and explicit evaluation checks.

A common misconception is that “agent” means “more advanced” and therefore better. Often it means less predictable, more expensive, harder to test, and more dangerous in production. The default should be a fixed workflow; add agentic behavior only where the workflow would otherwise need brittle branching or human judgment. After this lesson, you should be able to sketch the task, mark which decisions are fixed versus unknown, and choose the simplest architecture that can reliably solve it.

Common questions

What is the difference between an agent and a workflow?
A workflow follows a predetermined path controlled by your code. It may call a model, validate output and write results, but the order is fixed. An agent runs a model-driven loop that can choose tools, inspect intermediate results, retry, change direction or stop based on what happens during execution.
Why not use an agent for every AI task?
Agents add variability, runtime cost and operational risk. They are harder to test because the path can change between runs, and harder to explain when they fail. If the inputs, steps and success criteria are stable, a fixed workflow is usually cheaper, more observable and easier to ship safely.
When is an agent the right architecture?
Use an agent when the task genuinely needs runtime judgement: choosing which sources to inspect, deciding which tool to call, iterating until enough evidence is gathered, or handling open-ended investigation. Even then, constrain it with allowed tools, permissions, timeouts, budgets and explicit checks for acceptable results.