85 agentic tools audited for security incidents · Talk to the lab →
MotionticBook a call
Compare

Workflow vs agent: code decides the path, or the model does

A workflow runs model calls and tools along a path fixed in code, while an agent lets the model decide its own next step and which tool to call; workflows suit tasks with predictable steps, and agents suit tasks whose steps cannot be known in advance.

Checked

This is the most consequential design choice in an agentic system, and the one where Anthropic, OpenAI and Google agree most. All three say to start with the simplest design that works and reach for an agent only when the steps cannot be predicted.

They differ on where control should live once a system grows. Anthropic and OpenAI lean on the model loop. Google's 2026 framework pushes deterministic routing with model steps inside it.

What each one is

  • Workflow

    Model calls and tools orchestrated through code paths set in advance. Anthropic names five common patterns: prompt chaining, routing, parallelisation, orchestrator-workers and evaluator-optimizer.

  • Agent

    A model that directs its own process and tool use, looping until the goal is met or it hands off. The path is decided at run time.

What the three labs advise

  • Anthropic

    Begin with the simplest thing that works, and use agents for open-ended problems where the number of steps cannot be predicted.

  • OpenAI

    Build an agent only where deterministic approaches fall short: nuanced judgement, rule sets too complex to maintain, or heavy unstructured data.

  • Google Cloud

    Predictable tasks, or anything one model call can do, are often cheaper without an agent.

  • Google ADK 2.0

    Model loops are slow, costly and variable when used for routing and error handling. A graph of deterministic and model nodes cut tokens by about 50% and latency by about 20% in Google's refund example, and separating control flow from the model limits prompt-injection impact.

The hybrid most systems use

Production systems are rarely pure. A common shape is a workflow for the predictable spine, such as intake, validation, routing and record-keeping, with an agent inside the steps that need judgement, such as investigating an exception or drafting a response from several sources.

Motiontic's engineers draw that line per step, using two questions: can the steps be written down in advance, and what does a wrong step cost? The answer is tested with evals on the client's real cases, and steps move from agent to workflow when the agent keeps taking the same path.

A workflow compared with an agent

A workflow compared with an agent
WorkflowAgent
Who decides the next stepCodeThe model
PredictabilitySame path every runPath varies with the input
Cost and latencyLower and stableHigher and variable
DebuggingFollow the code pathRead the trace of each run
FitsKnown steps, high volume, strict rulesOpen-ended tasks needing judgement
Fails whenInputs fall outside the designed pathsContext grows and the loop drifts

Common questions

What is the difference between a workflow and an agent?

In a workflow, code fixes the sequence of model calls and tools. In an agent, the model decides its own next step and which tool to call. Anthropic draws this distinction in its guide to building effective agents.

When should an agent be used instead of a workflow?

When the steps cannot be predicted in advance, when the task needs judgement, or when inputs are messy and unstructured. Anthropic, OpenAI and Google all advise a workflow or a single model call wherever the path is predictable.

What is an agentic workflow?

An agentic workflow is a fixed sequence or graph of steps in which some steps call a model. Google's ADK 2.0 uses the term for graphs that mix deterministic routing nodes with model nodes.

Is a workflow cheaper than an agent?

Usually. A workflow makes a known number of model calls per run. In Google's ADK 2.0 refund example, moving routing out of the model loop into a graph cut tokens by about 50% and latency by about 20%.

Can a workflow contain an agent?

Yes, and many production systems do. The workflow handles the predictable steps and calls an agent for the step that needs judgement, then takes back control.

Running agents that have to hold up?

Describe the agent, the systems it touches and what it must never get wrong. The first call is with a lab engineer, who will say plainly whether it is ready for production, and whether Motiontic is the right team.