Key takeaways
- If the inputs are structured and the rules can be written down, write a script. Agents earn their cost on ambiguity.
- Scripts are cheaper per run, faster, consistent and easy to test. Agents add per-call cost, latency and variation.
- The best systems are hybrids: scripts do the repetitive spine, a model handles the one messy step, and a person handles exceptions.
- Measure cost per run, latency and error rate before you commit. Let the numbers choose the tool.
Why an AI agent is not always the answer
Agentic AI is the loudest idea in automation right now, and for good reason: agents can read messy input, choose between tools and carry a multi-step job through on their own. But each of those abilities has a price tag, and a lot of the work businesses want automated needs none of them.
A language model call costs money every time it runs, takes seconds rather than milliseconds, and can give a slightly different answer to the same input. A script does the same job for a fraction of the cost, finishes almost instantly, and behaves identically on run one and run one million. If a task is deterministic (same input, same rule, same output), paying for reasoning you don’t need is just a more expensive way to get a less predictable result.
That is the core of business process automation done properly: use the cheapest, most reliable tool that fully solves the problem, and save the expensive one for the part that genuinely needs it.
The four-question test: script or agent?
Before we reach for an agent, we ask four questions about the process. They take about ten minutes and settle most debates.
- Are the inputs structured?Rows in a spreadsheet, fields from an API or a fixed form point to a script. Free-form emails, scanned documents and chat messages point to a model.
- Can you write the rules down?If you could hand a new hire a checklist and they could follow it without asking questions, you can write it in code. If the honest answer is “it depends, I just know when I see it”, that is judgment.
- What does a wrong answer cost?An invoice posted to the wrong account is expensive. A draft reply that a person reviews is cheap. The higher the cost of an error, the more you want deterministic logic, tests and a human check.
- How often does it run?A small per-call cost is trivial once a day and a real line item at tens of thousands of runs a month. Volume turns small per-run costs into big ones.
Rule of thumb
Use AI agents for judgment and scripts for repetition. If a step is repetitive and rule-based, make it code. If it needs interpretation, give only that step to a model.
Script vs AI agent, side by side
| Criteria | Python script | AI agent (LLM-based) |
|---|---|---|
| Best for | Structured, rule-based, repetitive work | Ambiguous input, language and judgment calls |
| Cost per run | Close to zero, plus fixed hosting | Pay per token or call; grows with volume |
| Speed | Milliseconds to seconds | Seconds, and longer for multi-step reasoning |
| Consistency | Same input, same output | Can vary between runs |
| Testing | Standard unit and integration tests | Needs evaluation sets and spot checks |
| Typical failure | Loud: it errors and stops | Quiet: a confident but wrong answer |
| Maintenance | Changes when rules or APIs change | Also revisited when prompts or models change |
Where each one wins in practice
Scripts are the right call for
- Moving records between two systems that use fixed fields
- Nightly or weekly reports, reconciliations and data pulls
- Validating, cleaning and de-duplicating data against clear rules
- Filing, renaming and routing documents by a known pattern
- Anything that must be auditable and identical every time
Agents earn their cost when you need to
- Classify free-text emails, tickets or form answers
- Extract fields from messy or inconsistent documents
- Draft replies or summaries that a person approves
- Choose between several tools or steps based on context
Our Python automation work covers the first list and our AI agents and chatbots cover the second. Plenty of projects use both.
The hybrid pattern that scales
The best production systems rarely pick a side. They use a script as the spine and call a model only where interpretation is unavoidable.
- The script receives and validates the inputFixed rules handle everything that can be handled with rules.
- A model handles the one messy stepFor example, reading a free-text request and returning structured fields. Ask for a strict format and let code check the result.
- Code validates the model’s outputIf the output fails the schema or a sanity check, retry it or route it to a person instead of passing it on.
- A person reviews the exceptionsLow-confidence or high-value cases land in a review queue. This human-in-the-loop step is what lets you trust the rest to run unattended.
If you do give an agent tools, keep them narrow and well defined, increasingly through open standards such as the Model Context Protocol (MCP), rather than broad access to everything. An agent that can only do three things can only go wrong in three ways.
Decide with numbers, not hype
Don’t pick the tool by how impressive it sounds. Run the process both ways on a small sample and measure three things:
- Cost per run, including model usage, hosting and the time people spend fixing mistakes
- Latency, from trigger to finished result
- Error rate, counted against a sample a person has checked by hand
Then iterate. Over time you build a library of small scripts that each remove one chore, and the savings compound without adding headcount. That is how modern teams scale without scaling cost.
Not sure which side your process falls on? That is exactly what the free audit settles, and we will tell you honestly if the answer is “a script”.
Frequently asked questions
What is the difference between an AI agent and an automation script?
A script follows fixed instructions you wrote in advance, so it does the same thing every time. An AI agent uses a language model to interpret input and decide which steps or tools to use, which makes it flexible but less predictable and more expensive to run.
Is agentic AI worth it for a small business?
It can be, for language-heavy work such as triaging emails or extracting data from messy documents. For fixed-rule chores like syncing data or generating reports, a script is usually cheaper and more reliable. A short audit of your processes shows which is which.
Can I start with a script and add AI later?
Yes, and it is often the best order. Build the deterministic workflow first, keep the messy step behind a clear interface, and swap in a model for that step once you have measured the baseline.
Aren’t scripts just old-school RPA?
Not quite. Traditional RPA often mimics clicks on a screen, which breaks when the interface changes. We prefer scripts that talk to systems through their APIs, with tests, logging and retries, which are typically far more robust.


