A script runs fixed code with no model calls. A workflow runs fixed steps that call a model at chosen points, and an agent chooses its own steps toward a goal.
Situation | Use | Why |
|---|---|---|
Fixed inputs, fixed checks | Script | Deterministic, cheap and reviewable; no model variance. |
Fixed steps with judgment calls inside | Workflow | Structure stays fixed while a model handles the fuzzy steps. |
Open-ended task, unknown steps | Agent | Only an agent can plan when the path is not known upfront. |
High stakes or irreversible actions | Script or workflow with approval | Fixed paths plus human gates beat free exploration. |
The example below uses abstract units, not any real price. Forty log files need the same triage, and both routes are estimated in the same units.
example parameters: 40 files, costs in abstract units
script route: 120 authoring + 40 runs x 1 = 120 + 40 = 160
agent route: 40 files x 8 + 25 review = 320 + 25 = 345
difference: 345 - 160 = 185, so the script route costs less here
crossover illustration: at 4 files the agent route costs 4 x 8 + 25 = 57
against a script at 120 + 4 = 124, so few runs favor the agent routedef check(cond, msg):
if not cond:
print("FAIL: " + msg)
raise SystemExit(1)
files = 40
script_total = 120 + files * 1
agent_total = files * 8 + 25
check(script_total == 160, "script total wrong")
check(agent_total == 345, "agent total wrong")
best = "script" if script_total < agent_total else "agent"
check(best == "script", "choice wrong")
print("PASS: script total 160 beats agent total 345 across 40 files")Start with a script for anything run more than a few times with fixed checks.
Promote to a workflow when one or two steps need judgment but the path is fixed.
Promote to an agent only when the step sequence itself is unknown upfront.
Recheck the choice after the run count grows: repetition favors scripts.
The standard mistake is automating with an agent first and scripting later. That order pays model cost on every run while the shape of the task is still being learned.
A script. The checks are fixed and runs repeat nightly, so deterministic code wins on cost and variance.
The script route: 160 against 345, a gap of 185 units.