Rules engines are back, and your agent is the interface, not the executor

Summarize:
Multi-step agents tend to fail the same way in production, with one bad call partway through the run cascading into every step after it. One fix is to split the work, so the large language model (LLM) proposes each action, a Decision Model and Notation (DMN) table decides whether it’s allowed, and a durable orchestrator executes only what’s approved.
Earlier this year, a developer on r/AI_Agents asked the question every team running agents ends up asking: when your agent screws up in production, how do you figure out which step went wrong? Their agent passed every test, then picked the wrong tool or gave a confident wrong answer in production, and the only way to find out the bad step was reading through traces by hand.
The most useful replies converged on the same idea: record every step and enforce deterministic checks for the things that must never happen, like external actions without human approval. Those replies describe the same move a lot of teams are making this year: walking back “let the model figure it out” architectures. This post walks through the pattern to build instead, using a fix that predates the LLM by decades.
Caveat: if your workflow is genuinely two steps and one API call, none of this post matters and you can safely close this tab.
This is for people running long-running, multi-step agents against real backends, where “the model got creative” means someone's about to file a support ticket.
An agent with 85% per-step success has roughly a 23% chance of completing a nine-step workflow correctly (0.85 raised to the ninth power, plain compounding). You can run it on your own calculator (it's worse than it sounds). Early steps look reliable while error compounds later, which is exactly the shape that makes “which step went wrong?” so hard to answer: six steps go clean, and one bad argument at step seven quietly poisons everything after it, and the run looks fine until it isn't.
And you can’t prompt your way out of this. Function calling with defined schemas is a real improvement over free-form text, but under the hood it's still statistically unpredictable: models hallucinate arguments and can pick the wrong tool. Structured Outputs with strict JSON-Schema-constrained decoding closes most of that gap at the format level, but it doesn't decide whether the LLM's proposed action is the right action for your business. The model can propose a syntactically perfect call to refund_order(order_id=...) and still be dead wrong that a refund is what the situation calls for. Schema validation catches malformed. It doesn't catch wrong.
The fix is a rules engine: the same category of technology that ran enterprise back-office logic for two decades before anyone said “LLM.”
The LLM is the interface. It reads the customer's message, the record from your customer relationship management (CRM) system and the last three emails exchanged, and produces a structured request: take action X on entity Y with parameters Z.
A rules engine validates and decides. The decision table is authored in Decision Model and Notation (DMN), a vendor-neutral standard for decision logic from the Object Management Group (OMG). It takes the LLM’s structured request and approves the deterministic branch, routes it to a human, or rejects it.
A durable orchestrator executes. It retries, human approvals, audit trail, recovery. This is not something you want to hand-roll.
The model brings judgment and language, and the rules engine and orchestrator bring predictability and proof.

This is the operating model that the UiPath Platform™ launched under: Agents think. Robots do. People lead. UiPath founder and CEO Daniel Dines has spent this year making the technical case for it: “The model can recognize that a rule must be checked. The rules engine should check it . . . The model orchestrates. The deterministic system executes.” Swap in a DMN table for the rules engine and UiPath Maestro™ for the deterministic system, and that's this post's architecture. It's a cost argument too. Dines calls stable, rails-based work a class of automation that “costs nothing per run.”
Every decision the table makes instead of the model is a token you didn't spend.
We’re not the only ones landing here. Camunda published the same approach in July 2025, bringing DMN tables and LLM connectors together inside a single workflow. And an arXiv paper, DMN-Guided Prompting, shows DMN tables can also encode reasoning the LLM interprets, folding the rules into the prompt when that helps. As independent lines of work land on the same architecture, it's usually a signal.
A word on DMN, since some readers won't have used it: it’s an OMG standard, first published in 2015 and designed to pair with Business Process Model and Notation (BPMN). It's a tabular way of writing business rules where each row derives an output from a set of input conditions, portable across vendors, readable without an engineering degree, and executable as-is.
If you've ever squinted at a nested if/elif block deciding refund eligibility and thought “this should be a spreadsheet,” you were describing a DMN table.
Consider a Salesforce example: a weekly job reviews hundreds of opportunities, flags stale or risky deals, drafts next actions, notifies owners, and updates records when approved.
LLM reads and proposes: for each opportunity, the model reads recent activity, notes, and email history, then emits a structured request, something like {action: "flagRisk", opportunityId: "...", reason: "no activity 21 days", proposedNextStep: "..."}. Structured Outputs handles the format contract.
DMN table decides: a decision table applies your actual policy, like approvals for big deals, customer success (CS) alerts on risky renewals, and rejection of anything outside the allowed action set gets. The rules live in a versioned table your ops team can read and edit, not buried in a prompt.
Orchestrator executes and remembers: UiPath Maestro runs the whole thing as a single process, the model as one task type, the DMN table as another, the Salesforce update as a third, humans as a fourth. It handles retries, human approval waits, and the audit trail. If step 7 fails after step 6 already committed, an error boundary event routes the instance to a fallback path you model, so the undo is a step that you design rather than one the engine runs for you.
Example: the DMN table behind the weekly Salesforce opportunity review
Here’s the table behind that weekly review (hit policy: FIRST, so rows are checked top to bottom and the first match wins):
Proposed action | Days since last activity (from Salesforce) | Opportunity size | Renewal risk flag | Route to | Notify |
|---|---|---|---|---|---|
Unknown action | - | - | - | Reject and log | - |
flagRisk | <21 | - | - | Reject and log (Salesforce data contradicts claim) | - |
Any allowed action | - | >$250,000 | Flagged | Human approval (account owner) | CS team |
Any allowed action | - | >$250,000 | - | Human approval (account owner) | - |
Any allowed action | - | - | Flagged | Auto-execute | CS team |
Any allowed action | - | - | - | Auto-execute | - |
Six rows, checked in order, and no branch the model's proposal can take that isn't already on the table. And row 2 validates the model’s “no activity in 21 days” claim against Salesforce instead of taking the model’s word for it.
That gives you three artifacts an auditor (or your own incident review) can read: the JSON schema the model must satisfy plus its raw output trace, the versioned DMN table plus the row that fired, and the orchestrator's timestamped, replayable audit log. Compare that to a raw agent trace where the only explanation you get is “the model decided.” So when someone asks which step went wrong, you point at the row that fired instead of reading traces by hand.
Your context may differ, but here's how I'd think about picking a stack for a workflow with long-running processes, retries, human approvals, audit trails, and backend integration:
Stack | Good for | Tradeoff |
|---|---|---|
Pure open-source agent framework (LangGraph, CrewAI) | Prototypes and workflows where the model itself is the system of record | No native audit logs or access controls in CrewAI’s open-source tier, and LangGraph's checkpoints aren’t a governed decision layer. Fine for internal tools where a rollback is a Slack message. |
Workflow engine plus LLM connector, no native decision layer (Temporal, AWS Step Functions, Azure Durable Functions) | Durability and retries | You build or bolt on the decision layer (DMN) yourself |
BPMN + DMN, extended with an AI agent connector (Camunda) | A decision layer that comes out of the box | You bring the LLM provider and governance, and there are no robots for systems without APIs |
Enterprise platform that natively orchestrates agents, robots, and people with BPMN + DMN (UiPath Maestro Orchestrate) | Regulated data, workflows spanning multiple backend systems, and anything that needs to survive an audit | You’re adopting a platform, not a library, and its business rules task is in preview today |
Why Maestro Orchestrate lands in that last row: agent, robot, and human orchestration ships as one platform, with SOC 2 attestation for UiPath cloud offerings and live instance supervision (pause, resume, and retry), built on two decades of making deterministic robotic process automation (RPA) bots reliable at enterprise scale.
And if you're already running a standalone rules engine like Drools or IBM ODM, you pair it with whichever orchestration tier above matches your durability needs. DMN isn't a hard requirement to make this work; a versioned, human-readable decision layer is, and Drools or ODM already gives you that.
If you’ve seen Jev from TypeSafe AI pitched as a deterministic rules model, it's worth being precise about where it fits. Jev is a trained model that returns typed answers (a choice, a score) with calibrated probabilities instead of generated text, which makes it a good fit for the judgment calls in this stack, like whether an email thread signals churn risk. The rules themselves are still something your team authors, versions, and reads line by line. In the example above, a Jev score would be one more input column in the decision table, and the table is still what turns that answer into an approved action.
Pro tip: the decision usually comes down to who owns the failure. If that's an ops team who's never opened a LangGraph trace, you want the rules and the process in a format they can read and edit. Maestro’s monitoring dashboard, for example, lets business owners and ops teams track process metrics and drill into instance traces when needed.

If you're reconsidering your agent approach right now, or designing one from scratch, here's the shortest path to the pattern:
Write the schema first. Before touching the model, define the exact structured request the LLM is allowed to emit: every action, parameter, and enum value.
Author the decision table on paper: real rows, real conditions. If your ops lead can't read it, it isn't done.
Wrap the model call in constrained decoding. If the model can emit a token that violates the schema, you don't have a contract, you have a wish.
Move execution into a durable orchestrator. Retries, human tasks, and audit trail aren't optional at production scale. Use Maestro if you want the DMN layer native, another engine if you'll build it yourself.
Instrument every layer: the model's raw output, the decision table row that fired, the orchestrator's step trace. That's your incident review kit for the next “which step went wrong?” moment.
None of this is heavy-lift engineering. A coding agent (Claude Code, Cursor, whatever you've standardized on), wired up through UiPath CLI and skills for coding agents, can scaffold the schema, the DMN table skeleton, and the constrained-decoding wrapper for you. What takes longer is getting your ops team to agree on the actual rules, which is exactly why step 2 asks you to put them on paper first.
Pick one narrow workflow (one Salesforce job, one refund flow, one ticket triage), rebuild it as LLM-plus-DMN-plus-orchestrator, and a few runs will tell you whether it fits your team.
If you try this, I'd like to see the DMN table you end up with. Post it on the UiPath Community Forum and tag me. The interesting arguments in this space are about which decisions belong in the table versus the prompt, and I don't think anyone, us included, has fully finished sorting that out.

Senior Director - Developer Relations, UiPath
Sign up today and we'll email you the newest articles every week.
Thank you for subscribing! Each week, we'll send the best automation blog posts straight to your inbox.
Sign up today and we'll email you the newest articles every week.
Thank you for subscribing! Each week, we'll send the best automation blog posts straight to your inbox.