How to Build Agentic Workflows From Observed Human Processes

Most agentic workflows rely on their underlying large language models to dictate which step or tool comes next, inside limits the enterprise sets. Building agents that fully understand the business and its context requires also:
- Decomposing the human process into single-responsibility agent tasks
- Choosing an orchestration model (a deterministic graph, an orchestrator with sub-agents, or a ReAct-style tool loop)
- Picking a toolchain of a framework such as LangGraph, a model, and tool access through the Model Context Protocol (MCP)
- Managing state and memory
- Adding human-in-the-loop gates and observability
- Evaluating the workflow against today’s human baseline before deployment
Each step depends on a process map that matches how the work runs, and the underlying challenge is not an AI problem but a context problem.
How to build agentic workflows: the steps at a glance
The procedure below is the full answer, in build order. Each step gets its own section, followed by a runnable code example and a FAQ.
- Decompose the process. Break the observed human process into agent tasks with one responsibility each, explicit inputs and outputs, and named exception paths.
- Choose an orchestration model. Use a deterministic graph, an orchestrator with sub-agents, or a ReAct-style tool loop, matched to how predictable the steps are.
- Pick the toolchain. Select a framework, a model, and MCP servers for tool access.
- Manage state, memory, and context. Persist state between steps, separate memory types, and keep context windows lean.
- Add oversight. Place human-in-the-loop gates, validation checks, audit trails, and tracing before any action reaches a system of record.
- Test, evaluate, and budget. Run repeated-trial evals, regression suites, and token and latency budgets, then compare the agent against today’s human baseline before production.
What makes a workflow agentic?
Agentic AI, in plain buyer terms, is software that reasons about a task, calls tools to act on other systems, and decides when the task is finished or needs a person. Anthropic separates two forms: workflows, where “LLMs and tools are orchestrated through predefined code paths,” and agents, where “LLMs dynamically direct their own processes and tool usage” (Anthropic), while OpenAI’s guide draws the line at control: applications that “integrate LLMs but do not use them to control workflow execution,” such as single-turn LLMs or sentiment classifiers, are not agents (OpenAI).
The four levels below differ in who controls the path:
| Approach | Who decides the next step | Fits | Breaks when |
|---|---|---|---|
| Rule-based automation (RPA, rules engines) | Preset code and criteria | Stable, fully specified tasks | Inputs vary or an undocumented exception appears |
| Single-prompt LLM call | No one; one model call returns one output | Classification, extraction, drafting | The task needs several steps or a system action |
| Agentic workflow (predefined path) | Code, with model calls at fixed points | Tasks that decompose into known subtasks | The path must change based on what the agent finds |
| Autonomous agent | The model, using tools in a loop | Open-ended tasks with unpredictable step counts | Errors compound across long runs without checks |
Anthropic advises teams to “start with simple prompts” and add multi-step agentic systems only when simpler solutions fall short; Gartner predicts that over 40% of agentic AI projects will be canceled by the end of 2027, due to escalating costs, unclear business value, or inadequate risk controls (Gartner, 2025). In the same release, Gartner states that many use cases positioned as agentic do not require agentic implementations. Gartner also estimates that only about 130 of the thousands of agentic AI vendors are real, and describes agent washing as rebranding existing products, such as AI assistants, RPA, and chatbots, without substantial agentic capabilities.
Step 1: Decompose the process into single-responsibility agent tasks
Each agent task should own one decision or one action, with defined inputs, a defined output, the tool it may call, and the condition that sends it to a person. The decomposition is only as good as the process map behind it, and most teams build that map from standard operating procedures (SOPs), workshops, and interviews that describe the documented path rather than the variants people run.
The evidence points to process understanding as the weak link: HFS Research surveyed 505 Global 2000 decision makers and found 37% layering agents onto existing workflows and 32% making limited process optimizations, with only one in five redesigning workflows explicitly for autonomy. Everest Group reports that pilots stall because they are bolted onto workflows never designed for them. In a separate HFS study with Genpact of 2,002 global enterprise executives, 33% named data debt as the single biggest AI blocker and 23% named process debt, and HFS states that process debt slows time-to-production for every agentic deployment.
Consider a hypothetical property claims intake process decomposed into tasks. The table shows the fields each task needs before anyone writes code:
| Agent task | Input | Decision or action | Tool | Escalate when |
|---|---|---|---|---|
| Intake classification | First notice of loss text | Classify peril and extract amount | None (model only) | Peril cannot be classified |
| Coverage check | Claim ID, peril, amount | Confirm policy limit and exclusions | Policy lookup API | Policy not found or peril excluded |
| Fraud screen | Claim history, claimant data | Score anomaly risk | Claims history API | Score above the threshold the business sets |
| Payout approval | Coverage result, amount | Approve, deny, or route | Payment system | Amount above the approval threshold |
| Customer notice | Decision, policy terms | Draft and send letter | Correspondence system | Decision is a denial in a regulated line |
The escalation column is where guessed processes fail first: a claims handler who checks a second screen in a legacy system before approving, or who routes certain perils to a senior adjuster by habit, carries a rule no SOP records. Observed work data closes that gap: a Context Graph of Work built from how the process runs captures the variants, cross-application handoffs, and exception paths that the decomposition has to account for. The section on grounded context below describes how that model is built.
Step 2: Choose an orchestration model
Match the orchestration model to how predictable the steps are. Use a deterministic graph when the sequence is known, an orchestrator with sub-agents when subtasks depend on the input, and a ReAct-style loop for narrow tasks that need continuous replanning. LangChain’s position is that “most agentic systems in production are a combination of workflows and agents,” and LangGraph supports mixing deterministic steps with model-driven steps in one graph (LangChain).
The three models compare as follows:
| Model | How control works | Fits | Documented failure modes |
|---|---|---|---|
| Deterministic graph | Code defines nodes, edges, and conditional routing; models run inside nodes | Regulated, auditable sequences such as document approval or claims intake | Recovery paths and edge cases must be encoded by hand; rigid when input shifts |
| Orchestrator with sub-agents | A central model breaks down the task, delegates to workers, and synthesizes results | Subtasks that cannot be predicted in advance; parallel research or investigation | 10 to 15 times the tokens of a single agent; supervisor relay errors; conflicting parallel writes |
| ReAct-style tool loop | The model interleaves reasoning, a tool call, and an observation until an exit condition | Narrow tasks that need replanning on each observation | Repetitive loops, false completion, and degraded tool selection as tools grow |
An orchestrator coordinates sub-agents through a fixed cycle. It reads the task and the shared state, chooses which worker runs next (or which several run in parallel), passes each worker a scoped instruction, receives a structured result, writes it to state, and decides whether to delegate again or finish. Anthropic describes orchestrator-workers as “a central LLM” that “dynamically breaks down tasks, delegates them to worker LLMs, and synthesizes their results,” with the key difference from parallelization being that the orchestrator determines subtasks from the specific input. OpenAI’s Agents SDK calls this the manager pattern, where specialized agents are invoked as tools and the manager keeps control of the conversation (OpenAI Agents SDK).
These three findings should shape the choice in regulated operations:
- Start with one agent: OpenAI recommends maximizing a single agent’s capabilities first and splitting into more agents only when the agent fails to follow complicated instructions or consistently selects incorrect tools.
- Keep writes single-threaded: Cognition reports that parallel agents made implicit choices that often conflicted, and that the multi-agent systems that now work keep writes single-threaded while agents contribute intelligence (Cognition).
- Limit group coordination: Microsoft’s Azure architecture guide recommends considering limiting group chat orchestration to three or fewer agents and avoiding it when a deterministic workflow is sufficient (Microsoft).
The MAST study of multi-agent traces identified 14 failure modes in three categories: system design issues, inter-agent misalignment, and task verification. Its authors report that many failures arise from interactions between agents rather than from the limitations of individual agents (MAST, 2025). For loops, Google Cloud’s guide sets three exits: a conclusive answer, a preset maximum number of iterations, or an error that prevents continuing (Google Cloud).
Step 3: Pick your toolchain: frameworks, models, and MCP tool access
Pick a framework that persists state, pauses for human input, and connects to MCP servers natively, then keep the model choice swappable. The Microsoft framework landscape consolidated in 2026: Microsoft Agent Framework reached version 1.0 for .NET and Python on April 3, 2026, and Microsoft describes it as “the direct successor” to Semantic Kernel and AutoGen, “created by the same teams” (Microsoft Learn).
The table compares the main frameworks against their official documentation and release pages (documentation reviewed on November 3, 2026):
| Framework (latest stable) | Orchestration model | State and checkpointing | Human-in-the-loop | MCP support | Production fit |
|---|---|---|---|---|---|
| LangGraph 1.2.19 (Oct 30, 2026), LangChain | Low-level graph mixing deterministic and model-driven steps | Checkpointers save state at each step; replay and fork from prior checkpoints | interrupt saves state and waits for resume input | Through LangChain’s MCPAdapter (beta) | Strong for auditable, stateful flows; requires more engineering |
| CrewAI 1.15.34 (Nov 1, 2026) | Flows plus sequential, hierarchical, or hybrid processes | Checkpointing for crews, flows, and agents; @persist for Flow state | @human_feedback pauses a Flow for review | mcps field on agents; MCPServerAdapter | Fast to stand up role-based crews; frequent releases, including breaking changes |
| Microsoft Agent Framework (Python 1.24.0, .NET 1.27.0, Oct 30, 2026) | Sequential, Concurrent, Handoff, Group Chat, Magentic, plus graph workflows | Checkpoints at the end of each superstep; in-memory, file, or Azure Cosmos DB storage | Tool approval emits a RequestInfoEvent; pending requests survive checkpoint restore | MCPStdioTool and MCPStreamableHTTPTool | Microsoft’s go-forward path with long-term support commitment |
| Semantic Kernel 1.46.0 (Oct 28, 2026) | Concurrent, Sequential, Handoff, Group Chat, Magentic (marked experimental) | Stateful Process Framework steps checkpoint progress; thread serialization | human_response_function callback in Handoff | MCPStdioPlugin and MCPStreamableHttpPlugin | Supported for existing workloads; Microsoft directs migration to Agent Framework |
| AutoGen 0.7.5 (Sep 30, 2025) | GraphFlow team over a directed graph | save_state and load_state on teams | Save team state, resume when feedback arrives | McpWorkbench | Maintenance mode; the README tells new projects to use Microsoft Agent Framework |
Microsoft commits to supporting Semantic Kernel v1.x for at least one year after Agent Framework leaves preview and becomes generally available (Microsoft Agent Framework blog). AutoGen’s own dev documentation advises against production use.
Models now offer context windows near 1 million tokens across all three major providers. Context windows for representative models, per official documentation accessed November 3, 2026:
| Model | Context window | Max output | Source |
|---|---|---|---|
| Claude Opus 5.5 (Anthropic) | 1M tokens | 128K | Anthropic Claude Opus 5.5 documentation |
| Claude Sonnet 5.5 (Anthropic) | 1M tokens | 128K | Anthropic Claude Sonnet 5.5 documentation |
| GPT-6.1 Sol (OpenAI) | 1.05M tokens | 128K | OpenAI API documentation |
| Gemini 4 Argon (Google) | 1,048,576 tokens, shared across input, thinking, and output | 65,536 by default | Google Gemini 4 Argon documentation |
Keep the orchestration layer model-agnostic so a model change or a failed eval on one model does not force a rebuild.
MCP: the bridge from agents to tools and APIs
MCP standardizes how an agent discovers and calls external tools, so one integration serves every MCP-capable framework and model. Anthropic created MCP and launched it in November 2024; on December 9, 2025, the Linux Foundation announced the Agentic AI Foundation with MCP among its founding contributions. OpenAI, Google, Microsoft, LangChain, CrewAI, and Microsoft Agent Framework all document MCP support.
The protocol has three roles. A host (the agent application) runs one MCP client per server, and each server exposes three primitives: tools the model can invoke, resources that supply context such as records or file contents, and prompts that users invoke explicitly. The 2026-07-28 specification defines MCP as a stateless protocol in which every request carries its own protocol version and capabilities. The 2026-07-28 release post retires the initialize/initialized exchange and the Mcp-Session-Id header.
Tool access also opens a new attack surface. Invariant Labs disclosed “Tool Poisoning Attacks,” in which a malicious server can exfiltrate sensitive data and override instructions from other trusted servers, and the OWASP MCP Top 10 lists token mismanagement, privilege escalation via scope creep, and tool poisoning. The specification and best-practice documents set the baseline controls:
- Audience-bound tokens: MCP servers MUST validate that access tokens were issued for them and MUST NOT pass client tokens through to downstream APIs, which creates a confused deputy problem.
- Untrusted metadata: Clients MUST treat tool annotations as untrusted unless they come from trusted servers.
- Client registration: The 2026-07-28 revision deprecates Dynamic Client Registration in favor of Client ID Metadata Documents.
- Scope minimization: The MCP security best-practices guide warns that broad scopes granted up front give an attacker lateral data access and privilege chaining.
- Change control: OWASP recommends snapshotting tool definitions at approval time and requiring re-approval when they change.
Step 4: Manage state, memory, and context windows
Persist workflow state outside the model, separate memory by type, and load instructions on demand rather than packing every rule into the prompt. State is the record of where a case stands: which steps ran, what they returned, and what is pending approval. LangGraph’s checkpointers persist a thread’s graph state at each step, and Microsoft Agent Framework creates checkpoints at the end of each superstep, so a crashed or paused run resumes without repeating completed work.
Memory follows the four types defined in the CoALA paper (CoALA, 2023):
- Working memory: Active information for the current decision cycle, persisted across model calls within one run.
- Episodic memory: Records of earlier decision cycles, such as how a similar case resolved last month.
- Semantic memory: Facts about the world and the business, such as policy terms and product rules.
- Procedural memory: How tasks are performed, stored in model weights, agent code, and the agent’s instructions.
LangChain maps these to two mechanisms: short-term memory through checkpointers scoped to one thread, and long-term memory through stores that persist across threads (LangChain). Procedural memory is the hardest type to source in regulated operations, because the rules for handling exceptions live in how experienced staff work rather than in any document. A Context Graph of Work is one way to capture those exception rules from observed work.
A million-token window does not remove the need for this discipline: Liu et al. found a U-shaped curve in which performance is highest when relevant information sits at the beginning or end of the input, and GPT-3.5-Turbo’s multi-document QA accuracy dropped by more than 20% when the relevant passage moved to the middle (TACL 2024). Chroma’s study of 18 models found that performance “grows increasingly unreliable as input length grows,” with every model scoring higher on focused prompts of about 300 tokens than on full prompts of about 113,000 tokens covering the same question (Chroma); NoLiMa found that at 32K tokens, 11 of 13 models dropped below 50% of their short-context baselines.
Externalized instructions keep the window lean, as Anthropic’s Agent Skills show by loading in tiers: about 100 tokens of name and description per skill at startup, the skill body (under 5,000 tokens) only when a request matches, and bundled reference files and scripts only when the agent reads or runs them (Anthropic). The same pattern is now an open standard, and OpenAI’s Codex and Microsoft Agent Framework document equivalent progressive loading. For tools, Anthropic’s Tool Search lets developers mark tools with defer_loading so definitions enter context only when needed, and its guidance suggests adding tool search once a toolset grows past roughly 20 tools.
Step 5: Add human-in-the-loop gates, validation, and observability
Place approval gates before any action that is irreversible, external, high-value, or about an individual in a regulated decision, and route to a person whenever the agent exhausts its retry limit. The EU AI Act requires human oversight of high-risk systems that is “commensurate with the risks, level of autonomy and context of use,” including the ability to override or reverse an output and to stop the system “in a safe state” (EU AI Act, 2024). Annex III lists creditworthiness evaluation and life and health insurance risk assessment and pricing as high-risk.
The criteria below come from regulators, standards bodies, and model providers:
- Irreversible or sensitive actions: OpenAI’s guide states that actions that are “sensitive, irreversible, or have high stakes should trigger human oversight until confidence in the agent’s reliability grows,” citing canceling orders, authorizing large refunds, and making payments.
- Decisions about individuals: GDPR Article 22 gives people the right not to be subject to decisions based solely on automated processing with legal or similarly significant effects, and CMS requires Medicare Advantage organizations to base medical necessity determinations on the circumstances of the specific individual.
- Materiality thresholds: The Federal Reserve, OCC, and FDIC’s SR 26-2 states that models of higher materiality warrant more comprehensive and rigorous oversight, and the EBA expects credit policies to identify the products, segments and limits for which automated decision-making is allowed.
- Repeated failure or low reliability: OpenAI recommends setting limits on agent retries or actions and escalating to human intervention when the agent exceeds them; the NIST GenAI Profile calls for human review where models are demonstrated to perform poorly.
- Plan-level review: Anthropic’s Plan Mode lets a user approve the whole plan before execution, which moves oversight from individual steps to the overall strategy.
No regulator in this research sets a dollar amount or confidence cut-off. NIST’s AI RMF states that human judgment should set “the precise threshold values” for trustworthiness metrics, so each enterprise sets, documents, and defends its own.
Gate design also has to account for approval fatigue: Anthropic reports that users approved roughly 93% of permission prompts. Grant Thornton’s “2026 AI Impact Survey Report” found that only 5% of organizations allow agents to execute high-stakes decisions without human review (Grant Thornton, 2026). OpenAI’s guardrails documentation adds a failure rule worth copying: fail closed if review times out or becomes unavailable.
Validation and observability make each gate auditable. The OpenTelemetry GenAI semantic conventions, still in development status, define an invoke_agent span with child chat spans for each model call and execute_tool spans for each tool invocation, recording model, token counts, and finish reasons. Prompt content and tool arguments are off by default and recorded only when content capture is enabled. LangSmith, Langfuse, and Arize Phoenix all ingest OpenTelemetry traces.
For audit evidence, LangSmith’s Enterprise audit logs export in Open Cybersecurity Schema Framework (OCSF) format for security information and event management (SIEM) tools, Langfuse describes its Enterprise audit logs as immutable records, and Phoenix retains traces indefinitely by default unless an administrator sets a retention policy.
Governed autonomy ties these controls to a process definition the business owns. Skan AI’s agentic operating procedures (AOPs) are machine-readable process definitions generated from observation of work that encode workflow steps, decision logic, exceptions, policies, and escalation thresholds (first-party description).
Step 6: Test, evaluate, and control cost before production
Evaluate agentic workflows on repeated trials, inspect the path as well as the final answer, and set token, turn, and latency budgets before the first production run, because teams overestimate reliability when they rely on single-run accuracy. On τ-bench, GPT-4o function calling reached about 61% task success on retail at pass^1 and fell to about 25% at pass^8, the probability that all eight attempts succeed (τ-bench, 2024). Anthropic illustrates the same effect: a 75% per-trial success rate over three trials gives about 42% (Anthropic).
A production eval suite for a regulated workflow combines four checks:
- Outcome checks: Compare the end state (the database record, the decision, the letter) against the expected state, as τ-bench does.
- Trajectory checks: LangChain’s AgentEvals offers strict, unordered, subset, and superset matching of tool calls against a reference path.
- Calibrated judges: Anthropic recommends grading each rubric dimension with an isolated LLM judge calibrated against human experts, and OpenAI warns of position and verbosity bias in judges.
- Regression from production: LangSmith’s documentation describes adding real traces to datasets so that “a failure you saw once becomes a test you run every time.”
Failure recovery belongs in the harness. Anthropic’s research system pairs agent adaptability with “deterministic safeguards like retry logic and regular checkpoints,” because one failed step can send an agent down an entirely different trajectory. Set hard turn limits: the OpenAI Agents SDK raises MaxTurnsExceeded when max_turns is exceeded, and LangGraph accepts a recursion_limit in the run config.
Cost control needs the same rigor. CIO reports a Greyhound CIO Pulse 2025 finding that 68% of digital leaders surveyed hit major budget overruns during their first few agent deployments, with nearly half of them pointing to runaway tool loops and recursive logic. Anthropic reports that multi-agent systems use roughly 10 to 15 times more tokens than single agents.
Consider a hypothetical token and latency budget for the claims workflow in Step 1. Every input below is an assumption to replace with measured values:
| Budget line | Assumption | Result |
|---|---|---|
| Model calls per claim | 6 orchestrator and worker calls | 6 calls |
| Tokens per call | 8,000 input, 600 output | 48,000 input, 3,600 output per claim |
| Monthly volume | 10,000 claims | 480 million input, 36 million output tokens per month |
| Multi-agent redesign | 10 times the single-agent tokens | 4.8 billion input, 360 million output tokens per month |
| Sequential latency | 3 seconds per model call | 18 seconds per claim before tool time |
Parallel sub-agents reduce wall-clock time but not cost, and contention adds delay. A study of a multi-agent tutoring system at a concurrency of 10 found the parallel-phase median 37% higher than individual agent medians (arXiv, 2026). Platform rate limits cap throughput as well; Copilot Studio, for example, allows 50 requests per minute for environments with one to 10 prepaid message packs.
The final gate before launch is a comparison against the people doing the work today. Skan AI simulates agent workflows and evaluates them against observed human baselines before promotion to production (first-party description), which requires a measured baseline in the first place. An agent that resolves 80% of cases means little until it is measured against the human accuracy, cycle time, and escalation rate on the same case mix.
Worked example: a multi-agent pipeline in code
The example below is written to run locally on langgraph 1.2.19, the release listed in Step 3, with no API keys. It implements one deterministic orchestrator, two sub-agents (intake and coverage), shared state, one tool call, a human approval gate for payouts above a threshold, and an audit trail. The claims scenario, policy data, and threshold are illustrative.
# Illustrative claims pipeline: one orchestrator, two sub-agents, shared state,
# one tool call, and a human approval gate. Requires: pip install "langgraph==1.2.19"
from typing import TypedDict
from langgraph.checkpoint.memory import InMemorySaver
from langgraph.graph import END, START, StateGraph
from langgraph.types import Command, interrupt
APPROVAL_THRESHOLD = 5_000 # set and documented by the business, not the model
class ClaimState(TypedDict, total=False):
claim_id: str
claim_text: str
amount: float
peril: str
policy: dict
coverage_ok: bool
human_decision: str
decision: str
route: str
audit: list
def lookup_policy(claim_id: str) -> dict:
"""Tool call. In production, expose this as an MCP tool or internal API."""
policies = {
"CLM-1001": {"policy_id": "POL-77", "limit": 10_000, "excluded_perils": ["flood"]},
}
return policies.get(claim_id, {})
def log(state: ClaimState, step: str, detail: str) -> list:
return state.get("audit", []) + [f"{step}: {detail}"]
def intake_agent(state: ClaimState) -> dict:
"""Sub-agent 1: classify the peril. Replace the keyword rule with a model call."""
text = state["claim_text"].lower()
peril = next((p for p in ("flood", "fire", "theft") if p in text), "other")
return {"peril": peril, "audit": log(state, "intake", f"peril={peril}")}
def coverage_agent(state: ClaimState) -> dict:
"""Sub-agent 2: check coverage with the policy lookup tool."""
policy = lookup_policy(state["claim_id"])
ok = (
bool(policy)
and state["peril"] not in policy["excluded_perils"]
and state["amount"] <= policy["limit"]
)
return {
"policy": policy,
"coverage_ok": ok,
"audit": log(state, "coverage", f"policy={policy.get('policy_id')} ok={ok}"),
}
def human_approval(state: ClaimState) -> dict:
"""HITL gate. LangGraph re-runs this node on resume, so keep it free of side effects."""
answer = interrupt({
"claim_id": state["claim_id"],
"amount": state["amount"],
"question": "Approve payout above threshold?",
})
return {"human_decision": answer, "audit": log(state, "human_approval", answer)}
def orchestrator(state: ClaimState) -> dict:
"""Deterministic supervisor: decides which worker runs next."""
if state.get("peril") is None:
route = "intake"
elif state.get("coverage_ok") is None:
route = "coverage"
elif (
state["coverage_ok"]
and state["amount"] > APPROVAL_THRESHOLD
and state.get("human_decision") is None
):
route = "human_approval"
else:
route = "finalize"
return {"route": route}
def finalize(state: ClaimState) -> dict:
decision = state.get("human_decision", "approve") if state["coverage_ok"] else "deny"
return {"decision": decision, "audit": log(state, "finalize", decision)}
builder = StateGraph(ClaimState)
for name, fn in [
("orchestrator", orchestrator),
("intake", intake_agent),
("coverage", coverage_agent),
("human_approval", human_approval),
("finalize", finalize),
]:
builder.add_node(name, fn)
builder.add_edge(START, "orchestrator")
builder.add_conditional_edges(
"orchestrator",
lambda s: s["route"],
["intake", "coverage", "human_approval", "finalize"],
)
for worker in ("intake", "coverage", "human_approval"):
builder.add_edge(worker, "orchestrator")
builder.add_edge("finalize", END)
graph = builder.compile(checkpointer=InMemorySaver())
config = {"configurable": {"thread_id": "CLM-1001"}, "recursion_limit": 12}
result = graph.invoke(
{
"claim_id": "CLM-1001",
"amount": 7_200,
"claim_text": "Kitchen fire damaged cabinets and wiring",
},
config,
)
if result.get("__interrupt__"):
print("Paused for review:", result["__interrupt__"][0].value)
result = graph.invoke(Command(resume="approve"), config)
print(result["decision"])
for line in result["audit"]:
print(line)
The run pauses at the gate because the $7,200 claim exceeds the $5,000 threshold, then resumes from the checkpoint with the reviewer’s answer. The printed audit trail reads intake: peril=fire, coverage: policy=POL-77 ok=True, human_approval: approve, and finalize: approve.
Each element maps to a step in this guide: the ClaimState schema and the thread_id checkpoint are the shared state from Step 4. The orchestrator is a deterministic supervisor from Step 2, which a team can swap for a model-driven router once evals justify it. The interrupt call is the Step 5 gate, and recursion_limit is the Step 6 turn budget.
To move toward production, replace the keyword rule and the policy dictionary with model calls and an MCP tool, and replace InMemorySaver with a durable checkpointer; LangChain recommends AsyncPostgresSaver or MongoDBSaver for production human-in-the-loop persistence.
How grounded context changes agentic workflow reliability
Skan AI is an agentic AI platform for regulated enterprises that builds a Context Graph of Work from observed process activity, so banks, insurers, and healthcare payers can ground agent decisions and execution in how work runs. Each step above depends on that context: the decomposition in Step 1, the escalation thresholds in Step 5, and the human baseline in Step 6 are only as accurate as the process map behind them.
The observation-to-agent pipeline runs in a fixed sequence:
- Skan AI Blueprint identifies the areas to address with a lighter opportunity scan, including role-level time analysis and a prioritized roadmap with dollar impacts that recommends which work to assign to agents, augment, or keep with people.
- Skan AI Process Intelligence then observes those identified areas in depth: the Skan Virtual Assistant uses computer vision to capture work activity across mainframe, Citrix, VDI, legacy desktop, web, and office tools, and the platform stitches those events into end-to-end flows, variants, exception paths, bottlenecks, and drift signals.
- Skan AI Agents execute work through UIs and APIs under AOPs, with deterministic-first execution and governed reasoning.
Skan AI captures work with zero integrations, APIs, or logs and builds end-to-end process depth: the Skan VA observes work on screen through computer vision instead of connecting to source systems. That depth matters for cross-application work where systems share no data layer and event logs miss the handoffs. This capture approach does not limit downstream connection: the platform is model-agnostic, so the context it produces can feed the frameworks compared in Step 3.
Privacy by design applies to Skan AI’s capture layer. Skan AI redacts sensitive information at the pixel level on premises before anything is transmitted; raw screen data is designed to stay in the customer environment, and only anonymized, abstracted metadata about work patterns reaches analytics. Customers control application allow-lists, pseudonymized identities, retention, and deletion.
Deployment options are on-premises inside the customer firewall, private cloud, or Skan AI hosted. Skan AI holds SOC 2 Type 2, ISO/IEC 27001, and ISO/IEC 42001 certifications and maintains HIPAA, GDPR, and CCPA compliance.
Test the pipeline against a process your team already knows well, and see how observed work becomes context for governed autonomy. Request a Skan AI demo.
The questions below cover the decisions architects and automation leads raise most often when they plan an agentic build.
Frequently Asked Questions
Yes. They can build multi-step workflows inside documented limits. ChatGPT Work handles longer multi-step tasks and lets users approve important actions, and OpenAI is shutting down Agent Builder on November 30, 2026. Zapier caps Zaps at 100 steps, and its Looping step does not support nested loops. Zapier has announced nested loops for its Next Gen Zaps, which are in early access. n8n can require human approval before an AI Agent runs a gated tool, but its Simple Memory node does not work in queue mode. Copilot Studio supports up to 128 tools per agent and recommends 25 to 30. These tools fit bounded workflows; regulated, cross-application processes still need observed process context and enterprise governance.
For new production builds in November 2026, LangGraph and Microsoft Agent Framework support stateful, auditable workflows. LangGraph mixes deterministic and model-driven steps in one graph and checkpoints state at every step, while Microsoft Agent Framework is the successor to AutoGen and Semantic Kernel, reached version 1.0 in April 2026, and checkpoints at superstep boundaries. CrewAI fits teams that want Flows and role-based crews, and AutoGen is in maintenance mode, so start new projects elsewhere.
MCP is an open protocol, created by Anthropic and now governed under the Linux Foundation’s Agentic AI Foundation, that standardizes how AI applications connect to external tools and data. A host runs MCP clients, each client talks to one server, and servers expose tools the model can invoke, resources that supply context, and prompts that users trigger. Under the 2026-07-28 specification, each request carries its own protocol version and capabilities, HTTP servers validate that access tokens were issued to them, and clients treat tool annotations as untrusted unless the server is trusted.
Place gates before irreversible, external, or high-value actions, before decisions about individuals in regulated use cases, and wherever the agent exceeds its retry limit. OpenAI’s agent guide names canceling orders, authorizing large refunds, and making payments as actions that should trigger human oversight. The EU AI Act requires oversight commensurate with risk, autonomy, and context for high-risk systems such as creditworthiness scoring. No regulator in this research sets a dollar threshold, so each enterprise sets and documents its own.
Run each task several times and measure pass^k, the probability that all k attempts succeed, alongside trajectory checks and calibrated LLM-as-judge scoring. On τ-bench, GPT-4o scored about 61% on retail tasks at pass^1 and fell to about 25% at pass^8. Turn every production failure into a regression test, compare agent results against the measured baseline of the people doing the work today, and block deployment when scores drop.

