# Agentic workflows vs RPA: what changes and what stays

> An honest comparison of agentic workflows and RPA on determinism, exceptions, maintenance, audit and cost per run, with an invoice-exceptions walkthrough.

- Published: 2026-04-28; last updated 2026-11-13
- Author: the WeStack AI team
- Subject: Workflow automation
- Address: https://westack.ai/blog/agentic-workflows-vs-rpa

> RPA replays a script against a screen and stops when the screen or the input is not what it expected. An agentic workflow puts a language model at the points where a decision is needed, so the process can deal with inputs nobody scripted. In practice most processes end up as a hybrid: deterministic steps in code, model-made decisions at a few named points, and people on the exceptions that carry real risk.

## What RPA does well and where it breaks

Robotic process automation records what a person does in an application and plays it back: open this screen, find this field, paste this value, press this button. It needs no change to the underlying systems, which is why it spread so quickly through finance and operations teams that could not get integration work prioritised.

It breaks in two places. The first is the screen. A bot finds a button by a selector, and when a release renames or moves the element, the bot stops. The second is the input. A bot follows rules, and when an email, a PDF or a case arrives that the rules did not anticipate, the bot hands it to a person. Every RPA estate we have looked at has the same shape: bots doing the predictable majority, and a queue of exceptions worked by the people the automation was meant to free.

The RPA vendors know where the pain is. Microsoft's Power Automate has a [self-healing feature in preview](https://learn.microsoft.com/en-us/power-automate/desktop-flows/self-healing) that uses a model to find the intended element when a selector no longer matches, and UiPath documents a [Healing Agent](https://docs.uipath.com/agents/automation-cloud/latest/user-guide-ha/what-is-healing-agent) that proposes or applies fixes when a screen automation fails. Both put a model on the screen problem. Neither changes what a bot does with an input it has no rule for.

## What an agentic workflow changes

The term is used loosely, so it helps to borrow the distinction Anthropic draws in [Building effective agents](https://www.anthropic.com/engineering/building-effective-agents). Workflows are "systems where LLMs and tools are orchestrated through predefined code paths". Agents, by contrast, direct their own process and choose their own tools. Most of what businesses call an agentic workflow is the first kind, and we think that is the right default. UiPath's [documentation](https://docs.uipath.com/agents/automation-cloud/latest/user-guide/about-agents) draws the same line from the other side: robots are deterministic and rule-based, agents are probabilistic, and the two are meant to be orchestrated together with people.

Three things change when a model joins the process.

Unstructured input becomes usable. An email with a scanned attachment and a vague subject line can be read, and the facts in it put into fields.

Exceptions can be classified, and often resolved, where before they were only queued. The model looks at the case and the records around it and says what kind of problem it is.

The next step can be chosen at run time from a permitted set. That matters when the right path depends on what the documents say.

## What stays the same

Just as much stays. You still need a process that someone has written down, an owner, access controls, an audit trail, a queue for the cases the automation cannot finish, and monitoring that tells you when it is going wrong. The systems of record are still the source of truth.

A model does not remove the need to understand the process. It punishes not understanding it. Given a badly defined step, a bot stops, while a model does something plausible.

## Agentic workflows vs RPA, compared

| | RPA | Agentic workflow |
| --- | --- | --- |
| Determinism | Same input, same steps, same output. | Model decisions can vary between runs. You constrain them with schemas, rules and tests. |
| Exception handling | Stops and queues anything outside its rules. | Can read, classify and often resolve the case. Still needs a queue for doubtful or high-value cases. |
| Maintenance | Breaks on screen and format changes. Fixes are script edits. | Tolerates format changes better. Needs eval upkeep, prompt changes and re-testing when a model is retired. |
| Auditability | Strong by default: the script is the record. | Strong only if you build it: log the inputs, the model and prompt version, the output and the rule that acted on it. |
| Cost per run | Very low per step. Licences and maintenance dominate. | Tokens for each decision, so higher per run. Lower per case when it removes manual handling. |
| Speed | Fast, limited by the application. | Each model call adds seconds. |
| Inputs | Structured data and stable screens. | Free text, documents and images as well as structured data. |
| How it fails | Loudly: it stops. | Sometimes quietly: a plausible wrong answer. |

The last row is the one to design around. A stopped bot is an operational nuisance. A confident wrong classification that flows through to a posting is a control failure. Everything in the hybrid pattern below exists to turn quiet failures into loud ones.

## Where is RPA or plain code still the right answer?

Use plain code when there is an API. An integration written against an API beats both RPA and agents on speed, cost and reliability, and the only good reason not to write one is that the API does not exist.

Use RPA, or keep the RPA you have, when the work is stable and the rules are complete: moving a nightly file, keying a fixed-format batch into a system with no API, running the same report every Monday. If exceptions are rare and each one takes a person two minutes, a model adds cost and risk for little return.

Keep models away from calculations. Tax, currency conversion, totals and tolerance checks belong in code. Keep them away from the final act of posting, paying or deleting as well. The model may recommend, and a deterministic step under your existing approval limits acts.

Do not replace working bots for the sake of it either. The cheapest place to add a model to an RPA estate is the exception queue: leave the bot alone and put the model where the people are.

Where the screen is the whole problem, because there is no API and the interface keeps changing, the newer option is a [browser or computer-use agent](https://westack.ai/blog/browser-and-computer-use-agents) that reads the page instead of following selectors.

## The hybrid most processes end up with

The pattern is easy to state. Code runs the process, and the model is called at named decision points. Each decision point has four parts:

1. A narrow question, with all the evidence attached.
2. An answer constrained to a schema, with the action chosen from a fixed list.
3. Validation in code. Does the answer refer to records that exist? Do the amounts add up? Is the action permitted at this value?
4. A routing rule: act automatically, or send the case to a person with the model's reasoning attached.

A decision from the model looks like this:

```json
{
  "exception_type": "price_variance",
  "evidence": "Invoice unit price 4.80, PO line 3 unit price 4.50",
  "proposed_action": "route_to_buyer"
}
```

Here `exception_type` and `proposed_action` are fixed lists, so the model cannot invent a new action. Providers support this directly. OpenAI's [Structured Outputs](https://developers.openai.com/api/docs/guides/structured-outputs), for example, constrain a response to a JSON Schema you supply. The schema guarantees the shape of the answer. It does not guarantee that the content is right, which is why step three exists.

We do not route on the model's own statement of confidence. Route on things code can check: the invoice value, the supplier's history, the type of exception, whether a second pass over the same case agrees with the first.

The orchestration itself should be boring. A workflow engine or a state machine, with retries, timeouts and idempotency keys so that a step that runs twice does not pay twice.

## Worked example: invoice exceptions

Take the accounts payable team at a mid-size manufacturer. Invoices arrive by email as PDFs. The ERP runs a three-way match between invoice, purchase order and goods receipt. Most invoices match and are paid without anyone looking. The rest land in a queue: price differences, quantity differences, missing PO numbers, duplicates, freight lines that are not on the order, invoices addressed to the wrong legal entity.

In the RPA version, a bot collects the attachments, keys the header fields into the ERP and lets the match run. Anything that fails goes to the clerks. The bot breaks whenever a supplier changes its invoice layout, and the clerks spend their days on the same six kinds of problem.

The hybrid version has seven steps.

1. **Intake, in code.** Poll the mailbox, store the file and hash it to catch exact duplicates.
2. **Extraction, by model.** Read the supplier, invoice number, dates, PO reference and line items into a schema. Code then checks that the lines sum to the total and the tax is arithmetically right. An invoice that fails those checks goes to a person. Our guide to [document AI](https://westack.ai/blog/document-ai-intelligent-document-processing) covers this step in depth.
3. **Matching, in code.** The three-way match and its tolerance rules stay where they are. No model is involved.
4. **Classification, by model.** For each failed match the model receives the invoice, the PO, the receipt records and recent history with that supplier. It returns an exception type, the evidence and a proposed action from the fixed list.
5. **Resolution, by rule.** Code decides what happens to the proposal. A freight charge under the policy limit is accepted. A price variance goes to the buyer who raised the PO, with the evidence in the message. A missing PO number, where exactly one open order fits the supplier, items and amount, is put to a clerk to confirm in one click. A request for a credit note is drafted for a person to send.
6. **Posting, in code.** Through the ERP's API if it has one, through the existing bot if it does not.
7. **Record.** Every decision is stored with its inputs, the model and prompt version, the output, the rule applied and who approved it.

Four measures tell you whether it works: the share of exceptions resolved without a clerk, the agreement between the model's classification and a clerk's on a weekly sample, the time from receipt to resolution, and the number of wrong postings traced to a model decision. The last should be zero by construction, because the model cannot post.

Roll it out in shadow. For the first weeks the model classifies and the clerks carry on as before, and you compare the two. Then turn on automatic resolution one exception type at a time, starting with the type that is cheapest to get wrong. The decision log from step seven is a dataset in its own right, and landing it somewhere you can query it is ordinary [data engineering](https://westack.ai/services/data).

## How to start

In the first week, export last month's exceptions from one process. For each one, note what kind of exception it was, what the person did and how long it took. You will see one of three patterns.

If a handful of types account for most of the queue and a rule would settle them, write the rules. You do not need a model.

If settling them means reading documents and making a judgement that a competent clerk makes the same way each time, you have a decision point for a model.

If every case is different and the amounts are large, leave them with people and give those people a summary.

Then make one decision: which single decision point you will automate first, and what rate of agreement with your own staff you need to see in shadow before the model's answer is allowed to act. Designing and building hybrids like this is part of our [workflow automation](https://westack.ai/services/workflow-automation) and [AI agents](https://westack.ai/services/ai-agents) work.

## Frequently asked questions

### Will agentic AI replace RPA?

Not for stable, high-volume work with complete rules, where a script is cheaper and gives the same result every time. What agents replace is the manual exception queue that sits beside every RPA bot, and some of the screen automation that breaks when interfaces change. Most organisations will run both, with models making decisions at specific points.

### What is an agentic workflow in plain terms?

It is a business process in which a language model makes some of the decisions: reading an unstructured input, classifying a case, choosing the next step from a permitted list. The steps around those decisions still run as ordinary code with fixed rules, access controls and logs, so the process stays predictable where it has to be.

### Is an agentic workflow more expensive to run than RPA?

Per run, usually yes, because each model decision costs tokens while a script step costs almost nothing. Per resolved case it is often cheaper, because the alternative to a model decision is a person working an exception queue. Compare the total cost per completed case, including maintenance and human handling, not the cost per step.

### Can auditors accept decisions made by a language model?

They can accept a process in which every model decision is logged with its inputs, the model and prompt version, the output and the rule that acted on it, and in which postings and payments are made by deterministic steps under existing controls. Keep the model out of calculations and out of approvals above policy limits.
