RPA, APIs or agents: three ways to automate and when each fits

RPA drives the screen, an API integration calls the system directly, and an agent decides its own steps. Because they fail in different ways and cost different amounts to keep running, the choice is best made separately for each step of a process.

By Nabil Ahmed7 minute read

The lunar surface near 21°S, 161°W, lit by a low Sun with night falling across one side.
The Moon near 21°S, 161°W. Rendered by Farside from NASA Lunar Reconnaissance Orbiter elevation data.

Many organizations pick their automation technology according to which team holds the budget. A center of excellence built around robotic process automation will usually propose a bot, the integration team an API project and the AI team an agent, and each is right about some steps and wrong about others.

The three are often read as successive generations of one idea, but they work at different layers. RPA operates the user interface, while an API integration talks to the system underneath it, and an agent uses a language model to decide what to do next before acting through one of the other two. The right choice depends on the individual step, chiefly on whether its system offers an interface and whether its input and path are predictable enough to write down in advance.

We recommend the most deterministic option that can handle each step, which in practice means an API where one exists, a bot where there is no API and the screen is stable, and an agent only where the step calls for judgment that rules cannot express, and a sizable process usually ends up using all three.

In brief

  • RPA, API integration and agents automate at different layers (the screen, the system interface and the decision), which is why they complement each other more often than they compete.
  • When a system offers a suitable interface, an API integration is the most reliable option and the cheapest to maintain, because it depends on a published contract rather than on the screen layout.
  • RPA is the right tool for systems with a stable interface and no usable API, and each bot should be treated as a bridge that has an owner and an exit plan.
  • Agents fit steps where the input is unstructured or the path cannot be listed in advance, and they need evaluation, tracing and tight permissions that the other two approaches can do without.
  • The choice is best made separately for each step of a process, and the deterministic parts should stay deterministic even when an agent takes part.

Three mechanisms, three layers

Robotic process automation (RPA) is software that operates an application's user interface as a person would, logging in, finding fields on the screen, typing, clicking and reading the results. Products such as UiPath, Automation Anywhere, Blue Prism and Microsoft Power Automate supply the recorder and scheduler along with the bot runtime, and the appeal is that the target system is left unchanged and its owner need not cooperate.

API integration is code or configuration that calls a system's programmatic interface, which may be a REST or SOAP service, a message queue, a database procedure or a file exchange. It bypasses the screen to work with the system's data directly, so it relies on an interface that covers what you need.

An agent is a program in which a language model chooses the next action and calls a tool to carry it out, looping over each result until the task is complete. Its tools are usually APIs and occasionally a browser, and the model decides the sequence of steps at run time, whereas in the other two a developer writes it beforehand.

That difference matters most when choosing between them. RPA and API integration are both deterministic, meaning a given input follows the same path every time and that path can be read before it runs. An agent offers no such guarantee, so the flexibility that lets it handle unanticipated inputs also lets it take unanticipated actions.

How each one breaks

All three tend to work when first shown, so the useful comparison is how each fails after six months in production.

RPA breaks when the screen changes. A bot finds fields by selectors, positions or images, so a vendor update that moves a button can stop it, as can a new pop-up, a slow page load or a session timeout, and in the worse case it types into the wrong field. Such failures are frequent but usually visible. Operating costs are easier to miss, since each bot needs a user account with real permissions and rotated credentials, and it can only work as fast as the interface.

API integrations break at the edges of the contract. A provider may change a field or deprecate a version and may start enforcing a rate limit, and a network timeout in mid-request can lead a naive retry to create the same order twice. The remedies are well understood: versioned contracts, retries with backoff, dead-letter queues and idempotency, the property that makes a repeated request safe, explained in idempotency explained. With those measures an integration is the most stable form of automation available, but without them it can lose or duplicate work and report no error.

Agents fail by making a wrong decision without raising an error. An agent can misread an email or pick the wrong record from a search result, or take a plausible action that policy forbids, and each time the run finishes normally. Agents are also open to prompt injection, where the model treats text inside a document or email as an instruction. Neither problem rules agents out, but together they mean an agent needs four things the other approaches can manage without: a regularly run test set of real cases, a trace of every decision, a hard limit on what its tools can do, and a person to hand off to.

Side by side

RPA API integration Agent
Works through The user interface The system's programmatic interface A language model choosing tools
Input it handles well Structured, predictable Structured, validated Unstructured or variable
Path through the work Scripted in advance Coded in advance Chosen at run time
Same input, same result Yes, while the screen is unchanged Yes Not guaranteed
Typical failure Screen change, timing, session expiry Contract change, timeouts, duplicates Wrong decision with no error
How you test it Replay scripts against a test environment Contract and integration tests Evaluation set of real cases, graded
Throughput Limited by interface speed and bot sessions High, limited by rate limits Limited by model latency and cost per step
Main running cost Fixing bots after interface changes, licenses Keeping up with version changes Model usage, evaluation, review of handoffs
Fits best Legacy systems with no API, stable screens Any system with a suitable interface Judgment steps, messy input, open-ended lookup

No column is better in general, so the table helps only once you know which column describes your step.

One process, three tools

Take a regional insurer processing a change of address on a motor policy. The requests come in as free-text emails and scanned letters, and the change must be made in a modern CRM and in a twenty-year-old policy administration system with only a terminal-style screen. Because rating depends on postcode, the change can also alter the premium.

The first proposal is one bot that reads the mailbox and types the new address into both systems. It handles the tidy emails but fails on a letter that mentions two policies, on an email saying "we are moving next month", and on a request from someone other than the policyholder.

The second proposal is an agent driving both systems through a browser, which copes with messy inputs but leaves a non-deterministic component typing into a policy system where one wrong keystroke changes someone's cover.

A better design splits the process by the nature of each step.

  1. Reading the request is a judgment step. A model pulls the policy number, the new address, the effective date and the requester's identity out of the free text, and flags anything unusual. It has no write access anywhere and outputs a structured record with a confidence signal, and unclear cases go to a person. A rules-based flow that uses a model only at the one step needing it is what we mean by intelligent automation.
  2. Updating the CRM is an API step. Since the CRM has a documented interface, a small integration validates the address against a postal reference and updates the record with an idempotency key, logging the change, which is routine systems integration work.
  3. Updating the policy system is an RPA step, for now. That system has no API and its screens have not changed in years, so a bot enters the address and triggers re-rating, then reads the saved values back and raises an exception on any unexpected screen. The insurer records that the bot exists only because the system lacks an interface, so it is retired along with that system.
  4. The premium change follows a rule. When the premium moves by more than a set amount, a person confirms the change before the customer is told, and no model is involved.

A workflow engine holds the sequence and state and manages retries. Inside it the model does the reading and the API and bot do the writing (the bot only where no API exists), while fixed rules decide whether a premium change needs confirmation.

How to choose for one step

Take each step through these questions in order, stopping at the first that fits.

  1. Should the step exist? If it only compensates for an upstream defect, fix that first, for the reasons in fix the process before you automate it.
  2. Is the input structured and the rule expressible? When both hold the step is deterministic and you continue with question 3. If either fails, go to question 5.
  3. Does the system expose an interface for this operation? If so, use it after checking that it covers the whole operation, including the validations the screen applies.
  4. If there is no interface, can one be obtained? Find out what a vendor module, a database procedure or a file import would cost. If none is within reach and the screen is stable, RPA is the fallback, with a written condition for retiring the bot.
  5. Is the judgment bounded? When the step comes down to "read this and fill in these fields" or "pick one of these categories", use a model inside a fixed workflow and save free-running agents for the cases in question 6.
  6. Is the path itself unknown in advance? Investigations, research across several systems and multi-step resolutions in which each action depends on what the last one found are where an agent earns its cost. Give it broad read access and narrow write access, a boundary discussed further in agent or workflow: a decision guide.

Be cautious with agents that drive a browser or desktop directly, because they add the uncertainty of model decisions to the fragility of screen automation. A scripted bot or an API remains easier to trust and to audit when writing to a system of record. An agent calling well-built APIs inherits their reliability, which is why agents depend on integration work and cannot replace it.

What to do next

Pick one process you plan to automate and list its steps with four columns: the system touched, whether it has a usable interface, whether the input is structured and whether the rule can be written down. Then check three things in your current estate:

  • Count the bots that exist only because a system lacks an API. If most of them point at one application, your bot inventory already holds the business case for giving it an interface or replacing it.
  • Find the integrations that have no retry or duplicate protection, because those can fail without anyone being informed.
  • For any agent in production or planned, ask for its test set, its trace and its permission list. An agent missing any of the three has not yet moved past the demonstration stage.

The goal is a process in which each step is done by the most predictable tool able to do it, with the steps linked by automation with proper exception handling and an audit trail, which will usually mean using more than one product.

Related services

Start a conversation.

A short paragraph is enough. A principal reads every message and replies within one working day.

Or email hello@farside.works. We use what you send only to reply. Privacy