megabuild.dev
Featured note

Agent vs workflow: choosing the right architecture

When a simple workflow is more reliable than an autonomous agent — and how to decide before writing the first tool.

A customer writes, “I was charged twice after switching plans.” A support assistant needs to find the account, inspect the charges, and explain what happened. It may also need to send the case to billing. Before adding tools, decide who chooses the next step when the evidence changes.

Start with the path you can describe

In a workflow, the application decides which steps run and in what order. For the duplicate charge, it can look up the account, fetch recent invoices, check whether both charges settled, and route the result. A pending authorization gets an explanation. Two settled charges go to billing for review. A missing account prompts the customer for more information.

A model can still help. It might extract an invoice reference or draft a reply from the records the workflow already retrieved. The application decides which records to fetch and when to escalate. If support starts seeing the same exception repeatedly, add a branch that covers it and test the branch with real examples.

Give the agent a decision it needs to make

Now consider a ticket that mentions an old account, a recent migration, and two invoice references that point to different records. The next useful lookup depends on what the previous lookup found. An agent could inspect the migration history, compare matching invoice IDs, or stop and ask the customer to confirm which account they used.

Give it a bounded investigation. Define the read-only tools, the evidence required to propose a resolution, and a limit on calls. Ask it to hand off when records conflict or the limit is reached. If you can name the exact decision where the workflow runs out of useful branches, you have a place to test whether the agent adds value.

Keep consequential actions behind approval

Let either implementation prepare a refund proposal with the account, invoice, amount, and evidence. Require approval from a person with refund authority before sending it to billing. At execution time, verify that the approved invoice and amount still match the request, and use an idempotency key so a retry cannot issue the refund twice.

Apply the same rule to both designs. The agent can decide what to investigate. The application owns permission checks, approval, and the record of what was executed.

Compare both on the same tickets

Use a small set of representative cases that includes a settled duplicate, a pending authorization, a missing account, a migration, and conflicting invoices. For each case, write down the evidence a correct answer must cite, the acceptable outcome, and which actions require approval.

Run both designs with the same model and access to the same records. Compare correct resolutions, unsupported claims, unnecessary handoffs, latency, and cost per resolved ticket. Run ambiguous cases more than once to see whether the agent changes its decision with the same evidence. Treat any write without valid approval as a failed run, even when the reply sounds right.

Keep the workflow for cases it handles reliably. Route ambiguous cases to a bounded agent investigation only if the evaluation shows that it resolves more of them at an acceptable cost and error rate. The evaluation then tells you exactly where autonomy earns its place.

Back to featured note