TL;DR: Ship a workflow whenever you can write the steps down before the input arrives: it is cheaper, faster, repeatable and testable path by path. Use an agent only for the decisions that depend on what gets discovered, fence that step inside a deterministic spine with read-only tools and a budget, and let production traces tell you when to move the line.
How to approach it
Answer with a test, not a preference. The test is "who should decide the next step, and could code decide it?" Then name the three costs of handing a decision to the model (tokens and latency, variance, test surface) and say what agency buys in return. Ask about the task before committing: how varied are the inputs, how costly is a wrong action, and is there a latency budget?
A strong answer
Apply the test step by step, not to the system as a whole. Take an expense-report assistant. Extracting fields from a receipt image needs a model, but the order of steps does not: extract, validate against policy, check for duplicates, route for approval. Code can decide that sequence, so a workflow wins. The one step with genuine uncertainty, "the receipt is in a language we don't usually see and the merchant is ambiguous", can be a fenced agentic step with a lookup tool and a budget of five turns.
Then quantify why the default should be code:
latency, illustrative workflow: 2 model calls × 1.5 s = 3 s
agent: 7 model turns × 1.5 s + tools ≈ 12 s
variance 6 model-made step choices at 0.98 each = 0.886 all correct
the same 6 steps fixed in code = 1 by construction
testing workflow: enumerate 4 paths, test each
agent: sample many runs, estimate a rate
Agency earns its keep when the path depends on what is found: triaging a bug, investigating a dispute whose cause could be billing, shipping or fraud, researching a question whose sources are unknown. The tell that a workflow needs an agentic step is a growing tree of exception branches that still misses cases.
The design most strong candidates land on is a deterministic spine with one bounded agentic step: code verifies identity, fetches data, runs the policy check and performs side effects; the agent investigates with read-only tools and returns a structured result that the spine validates before anything changes in the world.
Close with how you would keep the line in the right place: read the traces of the agentic step, and when 90% of runs take the same path, freeze that path into code. When a model upgrade lands, rerun the evals with fences removed one at a time to see which still earn their cost.
What interviewers probe next
"The product team says competitors market an 'autonomous agent'. Does that change your design?" No. The marketing word can describe the product; the architecture should still put agency only where the path is unknown, because that is what keeps the wrong-action rate and the bill down.
"Your workflow's intent router is itself a model. Isn't that an agent?" It is one bounded model decision with a fixed set of outcomes that code acts on. That is far easier to evaluate (a classification accuracy on labelled tickets) than an open loop.
"How would you know the agentic step is worth it?" Compare outcomes on the tickets it handles against the branch logic it replaced, at equal or acceptable cost and latency, measured across repeated runs.
What if?
What if · interview follow-ups
Hold your answer as the constraints change
An insurance team wants an agent to process claims: read the claim, check the policy, assess the damage photos, decide, and pay.
Start here
Which of those steps should the model control?
Which decisions depend on what is found?
Reading the claim and assessing the photos need a model; the sequence and the policy check do not. Code fetches the policy, applies coverage rules and limits, and decides whether payment is even possible. The model's photo assessment is an input to that rule, not the decision itself.
Carry it forwardGive the model perception and judgement, keep sequence and authority in code.
Weak answerOne agent with a pay tool and a prompt describing the policy.
Constraint changes
What if 15% of claims have unusual circumstances the rules don't cover?
Where does an open-ended step fit?
Route those to a fenced investigation step: an agent with read-only tools (claim history, adjuster notes, policy documents) that returns a structured recommendation with evidence. A human adjuster decides, because the cases are by definition outside the rules.
Carry it forwardAgency for the unknown path, people for the unprecedented decision.
Weak answerLetting the agent pay the unusual claims because it handled the common ones well.
Constraint changes
What if the latency budget is two seconds for a first response?
What can respond before the slow work finishes?
Acknowledge and classify fast with the workflow, then run the assessment asynchronously and notify the customer. An agent loop of several turns cannot fit a two-second budget, and it should not have to.
Carry it forwardLatency budgets push work out of the loop, not into a bigger model.
Weak answerChoosing a smaller model so the agent fits the budget, at the cost of the decision quality.
Now defend it
What is the one-sentence design?
A claims workflow in code that calls models for reading and photo assessment, applies coverage rules itself, routes uncovered cases to a fenced read-only investigation step, and sends anything outside the rules to a human adjuster.
How it's scored
Weak: Defaults to an agent because the task "involves several steps", or answers with "it depends" and never names what it depends on.
Hire: States the who-decides-the-next-step test, names cost, latency and variance, and proposes a workflow with an agent where the path is unknown.
Strong Hire: Applies the test step by step, quantifies variance and latency, proposes the deterministic spine with a fenced read-only agentic step and a validated output, and explains how traces and model upgrades move the line over time.
Common mistakes
- Treating "agent" as a product goal rather than an architecture choice.
- Giving the agent the side-effecting tools as well as the investigative ones, so the fence has a hole in it.
- Comparing designs on a demo run instead of on repeated runs across representative inputs.
- Forgetting that a workflow's model calls still need evals, just simpler ones.