Skip to content

From Chatbot to Workflow: Four Boundaries Every LLM Application Needs

9 min reading

Recent model applications make evidence, action authority, durable outcomes and operating budgets increasingly visible architectural decisions.

Page details

Blog 01 · Vikram Samal

Edition date: · 9 min read

20px

Edition dates place posts in a retrospective weekly reading sequence.

Last edited:

Sources · Technology essay

TL;DR
  • A workflow follows fixed application steps; an agent chooses steps through the model.
  • Evidence, authority, durable state and budget answer different failure questions.
  • Introduce a boundary when a specific failure requires it.

The answer says the refund is done.
The payment provider has said nothing.
Which record should support trust?

Hypothetical scenario. Act 1, launch day. Priya asks Northwind’s support bot to refund order 4471 and tell the customer. It answers “Done!” The conversation contains neither a provider receipt nor a durable action record. Dev can see the sentence, but cannot establish whether the customer received money.

Three systems that share a chat box

A chat interface exchanges messages with a language model. Its immediate product is text. A useful support chat can explain a policy or draft a reply without changing an order. The conversation is evidence of what was said; it is a separate object from the payment record that establishes what happened to money.

A workflow follows application-defined steps. For a refund, those steps could be checking the order, requesting approval, submitting an authorized operation and recording its outcome. A model can interpret the customer’s message within a step. The application determines which step is next and what evidence permits that transition.

An agent allows the model to choose subsequent steps or tools from observations. This gives flexibility when the path is not known in advance. It also moves part of the control decision into a probabilistic component. Anthropic’s workflow and agent distinction separates predefined paths from model-directed execution; that distinction is more useful than whether the product has a chat bubble.

EvidencePermissionAction recordBudget
Refund decisions cross four independently enforced boundaries; a fluent answer does not replace any of them.

One failure, four different owners

The first boundary concerns evidence: which facts enter the decision? Northwind needs an order identity, the applicable policy revision and the payment state. Retrieval selects passages for the prompt. It does not itself establish that a document is current or that the requester can read it. Dev owns the retrieval path; Priya owns the meaning of the support policy and how exceptions are reviewed.

The second boundary concerns authority: what is the application allowed to change? A model’s request to refund an order is a proposal. The payment service checks the authenticated user, the order, the amount and the approval. A tool description explains the interface; a permission check decides whether a particular invocation is allowed. Those responsibilities belong in the service that controls the resource.

The third boundary concerns state: what survives if the worker disappears? Northwind needs to distinguish an intended refund, an attempted refund and a confirmed refund. Saving the transcript alone combines these into language that another model must interpret later. An explicit action record keeps the distinction available to recovery logic and the person answering the customer’s next call.

The fourth boundary concerns budget: how much work can this request consume? Model calls, tool attempts and elapsed time are different resources. A remaining call does not imply that the caller still has time to wait for it. Sam needs an end-to-end deadline as well as counters; Priya needs a useful handoff message when the automation stops.

A small budget with an exact stopping rule

Hypothetical worked example: a support run starts with 3 model calls, 2 tool attempts and 20 seconds. It uses 2 model calls, 1 tool attempt and 14 seconds. Subtraction leaves 3 − 2 = 1 model call, 2 − 1 = 1 tool attempt, and 20 − 14 = 6 seconds. The three remaining values describe permission to continue, not proof that continuation will finish.

Suppose the remaining model step produces a customer reply, while the refund operation is still unresolved. Spending that last call on a success message cannot resolve the missing provider evidence. The application instead records the unresolved operation and produces a pending message. Budget exhaustion determines when to stop working; it cannot turn uncertainty into a successful business outcome.

The clock must include waiting, retries and approval pauses according to a declared rule. If a human approval suspends the interactive run, record a separate workflow deadline for that approval. Otherwise a worker restart can accidentally grant the same task a fresh allowance. Persisting the original deadline preserves the product promise across process boundaries.

Follow the refund through the gates

Northwind first resolves the order reference to an internal order and payment identity. Next it retrieves the relevant policy and checks the requesting employee’s scope. The model can help interpret the customer’s reason, while the application verifies eligibility and required approval. A refund request is issued only after those checks have produced an authorized action record.

OpenAI’s function-calling documentation describes a tool-call exchange in which the application executes a requested function and returns its result. That is an important division of labor: the model generates arguments; the application decides what to execute. Northwind keeps payment credentials out of the prompt and binds the permitted order identity outside model-generated prose.

Once the payment attempt starts, recovery follows that action identity. A timeout leaves the refund unresolved until a lookup or a reconciled result establishes its outcome. Customer notification follows confirmation, or explicitly states that confirmation is pending. The customer-facing sentence is downstream of the state transition rather than the event that causes the transition.

In the wild: simple paths before autonomous loops

Anthropic’s engineering guide recommends starting with simple compositions and adding complexity when a simpler solution falls short. Its prompt-chaining example places application checks between model calls. This is a documented design pattern, not a report that Northwind operated such a system. The practical lesson is to identify the failed decision before choosing a more autonomous architecture.

For the evidence boundary, OpenAI’s retrieval guide describes searching indexed files and returning relevant results. For the state boundary, Temporal’s workflow-execution overview describes durable execution across failures. Neither mechanism supplies the refund eligibility rule. Combining them is an architectural decision whose value depends on the failures Northwind actually needs to handle.

The authority concern also appears in OWASP’s prompt-injection guidance, which recommends least privilege and approval for risky actions. Reading a hostile email should not grant that email the authority to change an order. Northwind therefore evaluates retrieved content as evidence while keeping the permission decision attached to the authenticated workflow.

Choose the smallest design that preserves the contract

A fixed refund path is attractive when the allowed outcomes and checks are known. It gives Priya an understandable escalation route and Dev a small transition system to inspect. Agentic selection becomes useful when support requests require different investigation paths that cannot be predicted cheaply. The surrounding evidence, authority and budget checks still apply when the path becomes flexible.

There is a real cost to every extra durable transition and approval. A read-only policy explanation does not need the same recovery machinery as a payment write. Group related checks where their failure consequences are the same. Separate them where one action changes money, reveals private information or crosses a deadline that the other action does not.

A common misconception is that a longer system prompt creates all four boundaries. Instructions can explain the desired behavior, but the application still needs enforceable permissions, persistent records and counters. Another misconception is that giving the agent fewer tools solves every problem. A single refund tool remains consequential when its arguments or retry identity are uncontrolled.

Decide what a stopped run leaves behind

For Northwind, a useful failed run leaves an order reference, the evidence revision, the attempted action identity and the reason execution stopped. Priya can then continue without asking the customer to restart the story. The retained material should be sufficient for that handoff without copying unrelated private messages into every log or prompt.

Limits: a workflow boundary cannot guarantee correct source material, a perfectly calibrated model or a responsive payment provider. Its purpose is to make the application’s promises explicit and keep the consequences of uncertainty inspectable. The appropriate number of steps depends on the action’s impact and the available recovery evidence.

Northwind’s launch-day decision is to keep refunds on a fixed, approved workflow and use the model for interpretation and drafting. Evidence selection, service authorization, action recovery and spending limits each have a named owner. A later agent can investigate more flexibly while remaining inside those same independently checked boundaries.

Check yourself: chatbot decisions

The bot says “refunded,” but only the transcript survives. Is the operation confirmed?

No. Confirmation requires evidence from the payment system tied to the recorded action. The transcript establishes only that a claim was generated.

One call remains but the deadline has passed. Should execution continue?

No. The time allowance is an independent gate. Persist a handoff state rather than resetting the deadline or spending the remaining call.

A read-only policy assistant becomes a refund agent. Which new check is essential?

The service must authorize each payment action using identity, order and approval. A tool description or a retrieved policy cannot grant that permission.

Next read: Give tool actions a durable identity.

Source: Building effective agents — Inspect Primary Source ↗
VS
Vikram Samal

Notes on generative AI and system design.