Skip to content
← All posts
Case studyNovember 2026

AI drafts, people decide: agentic decision workflows

LangGraph assistants, a registry of reviewed queries and actions, and Temporal runs that wait for people.

On an agentic AI platform, analysts configure decision use cases for enterprise customers out of thousands of concepts, mappings, queries, rules and actions. Doing that by hand through forms does not scale, and letting a language model run free over customer data is not acceptable. With the team, I co-built an agentic workflow engine for that middle ground: AI drafts and explains, a deterministic core decides, and people approve.

Three rules

  • Configuration, not code. A new use case is assembled from reviewed building blocks and workflow steps in the UI. No domain logic lives in the platform.
  • AI drafts, the platform validates, people approve. No assistant publishes, approves or edits anything that is live.
  • Agents never decide. An agent's output can route a workflow or fill in a task, but decision outcomes come only from the rules step or from a person.

An assistant is a declaration

Each assistant is a small declaration rather than a framework of its own: a system prompt, the MCP tools it may use, the tools that must wait for a person before they run, and the evidence to show next to a proposal. One service turns that declaration into a LangGraph agent and streams each turn to the browser. There are about a dozen of them, one per job, and each page has one assistant slot.

Every tool call carries the signed-in person's identity, so an assistant can never do more than that person could. Write tools are interrupted by a human-in-the-loop step and become proposal cards with Accept, Reject and Send back. Long conversations stay affordable because, past a set size, older tool results are replaced with placeholders. Every model call and tool call gets a trace span and an audit line, recorded by argument names, never values.

Don't show people proposals that will fail

Early on, a draft that failed validation still reached the person, whose only option was to reject it. Now every proposal runs through the same checks the pages run before anyone sees it. If it fails, the service sends it back to the model with the errors, up to three times. Human attention is the scarcest resource in the loop, so people only see proposals that already pass.

A vocabulary, not a blank page

Assistants and workflows never write free-form SQL or call an arbitrary URL. They name an entry in a registry and pass parameters. A query reads data; an action calls an API that changes something. Both are versioned, tenant-scoped definitions with a lifecycle: a query goes from draft to published, an action from draft to active, and only a person makes that move.

The registry lives in a .NET service built on ASP.NET Core and EF Core, next to the APIs it binds to:

  • Identifiers never change and are never reused, even after a delete, so a workflow that names an entry can never silently point at something else.
  • Each API-backed entry stores a snapshot of its OpenAPI contract and a hash of it, so drift in the API underneath is detectable.
  • Stale saves are refused. The client sends back the version it read, and a save against a newer version gets a conflict instead of overwriting someone's change.
  • An entry can be published as an MCP tool, so agents outside the platform can call the same governed query or action.

Temporal for anything that waits

Every workflow run is a Temporal workflow, so its state survives crashes, deploys and week-long waits for a person without us writing any persistence code. A workflow definition is versioned JSON, and a single dynamic workflow class interprets all of them, so a new use case is configuration rather than a deploy.

When a run reaches a human task, it waits with the SLA as its timeout and can sit there for days at no cost. When the person submits the form, the run continues from exactly where it stopped. Agents work the same way: the run starts one and waits for its callback.

Work is split across task queues by kind, with one worker deployment per queue, so a slow agent or a busy data source never starves the decision path. Model calls get their own rate-limited queue. Large case data is stored outside Temporal's history and encrypted, and only a reference goes through it. Every change to workflow code that could alter replay is versioned, so runs started before a deploy replay exactly as they ran.

The 46%

In October an assistant turn took about 30 seconds, and only 8 of them were the model. We were rebuilding a 38,000-token domain brief on every turn. Caching it and moving to a compact brief of about 6,000 tokens cut turns from 26.6 to 14.3 seconds, 46% faster, with 69% fewer input tokens. The lesson was to measure the prompt before blaming the model.

Supporting both Claude and Azure OpenAI GPT through LangGraph meant giving up some provider-specific features. In exchange, a customer can run the whole platform on the provider they already have, and we verified that with the same task sets on both.

Takeaways

  1. Give the agent a vocabulary, not a blank page. Reviewed queries and actions are easier to test, permission and audit than generated SQL.
  2. Let AI draft and let people decide. Writes pause for a person, and decisions come from deterministic rules.
  3. Validate before the human sees it, and loop failures back to the model.
  4. Run tools as the person. Add a separate, narrow service path only for unattended runs.
  5. Use a durable workflow engine for anything that waits. Callbacks, reviews and SLAs become signals, updates and timers.

What it unlocked

This was my deepest work yet with LangGraph, MCP and Temporal together, across Python, .NET and React. It also sharpened a view I now bring to every AI feature: the interesting engineering is not the model call, it is everything around it that makes the result safe to act on.