All guides
Updated By Kartik Sarangmath

Four Ways to Build an AI Agent in 2026

Workflow builders, frameworks, harnesses, and runtimes, and when to use each

Vendors use the same words for different things. LangChain calls LangGraph a runtime, and Microsoft calls Copilot Studio's agent loop a harness. OpenAI's Agents SDK is a framework, but Anthropic's Claude Agent SDK is a harness.

I group the options into four ways to build an agent. They differ in how much of the agent you write yourself and how much someone else runs for you.

The Short Version

If you wantUseLike
Agents in production for many users, on any model, with sessions, machines, approvals, and crash recovery handled, hosted or on your own infrastructureA managed agent platformOmnara
A mostly fixed business process with a few AI decisions, owned by non-engineersA workflow buildern8n, Zapier, Make
To write every step of the agent inside your own app, and to run its sessions and crash recovery yourselfA framework, with durable execution if runs have to survive crashesLangGraph, OpenAI Agents SDK, Vercel AI SDK, Mastra, with Temporal or Inngest
A single agent that works with files, code, and a shell on one machineA harnessClaude Agent SDK, Codex, OpenCode, Pi
A prototype on one lab's models, with that lab running the agentThat lab's managed agent platformClaude Managed Agents, OpenAI's Agents API

Most production systems combine more than one. That's covered at the end.

Workflow Builders

A workflow builder is a canvas where you wire steps together: a trigger, some API calls, an AI step, an email. In most builders, that AI step is now a real agent loop. n8n's AI Agent node lets the model decide which tools to call, and so does AI by Zapier, which replaced Zapier Agents this month.

They break down as the agent grows. Large flows get hard to follow and review, and Git sync in n8n is only on the Business and Enterprise plans. Pricing per task, like Zapier's, adds up when an agent loops through dozens of tool calls. If agents run for hours or wait on approvals, check how many runs can be active at once and what happens to a waiting run after a crash.

Check that a builder will be around before you commit to it. Flowise shut down in August, and its team said developers were moving to coding agents. OpenAI is shutting down Agent Builder on November 30, 2026, and pointing people to its Agents SDK. The bigger builders are turning their workflows into tools that agents can call over MCP.

Use one when the process is mostly fixed and the model makes a few decisions inside it, like routing a support ticket or summarizing a lead before it goes into the CRM. They also fit when the people who own the process aren't engineers, or when you need hundreds of app integrations on day one.

The main options:

  • n8n. Self-hostable under its own fair-code license, with an agent node built on LangChain.
  • Zapier. Cloud only, with thousands of app integrations. Agents now live inside a single AI step in a Zap.
  • Make. A visual scenario builder. Its new agents app is still in open beta.
  • Microsoft Copilot Studio. Microsoft's low-code agent builder, built into Microsoft 365.
  • Dify. Self-hostable under a modified Apache license that limits multi-tenant use, with an agent node and its own sandboxed agent.

Agent Frameworks

A framework is a library you write the agent with. You define the tools and the logic around them, and it gives you model calls, memory, multi-agent patterns, and usually a basic loop you can change or replace. Hosting, sandboxes, and permissions are yours to build and run. So is crash recovery, unless you pair it with a durable execution engine.

The common complaint is that frameworks hide the prompts and make agents harder to debug. Anthropic's advice is still to start with the model API directly and add a framework only when you need one. Before you adopt one, check that you can see the exact prompts it sends, swap out its defaults, and upgrade it without rewriting your app.

Frameworks are also turning into harnesses. LangChain describes its create_agent as "a minimal, highly configurable agent harness". Pydantic AI 2.0 and AWS Strands now lead with a ready-made agent. Vercel's AI SDK 7 can run Claude Code, Codex, OpenCode, or Pi directly inside your app.

Use one when you need step-by-step control inside your own app. A framework lets you choose which tools and context the model sees on each step, mix fixed steps with agent steps, keep latency low, and use any model you want.

The main options:

  • LangChain and LangGraph. Python and TypeScript. LangGraph handles state and resuming.
  • OpenAI Agents SDK. Python and TypeScript. Built around OpenAI's models, but works with others.
  • Vercel AI SDK. A TypeScript toolkit for model calls and agents. Works with any model provider. Its WorkflowAgent runs agents as durable steps.
  • Mastra. TypeScript, with workflows, memory, and evals built in.
  • Pydantic AI. Typed Python, and works with several durable execution engines.
  • Google ADK. Works best with Gemini, with versions for Python, TypeScript, Go, Java, and Kotlin.
  • Microsoft Agent Framework. The successor to Semantic Kernel and AutoGen, for Python and .NET.
  • CrewAI. Python, built around teams of agents with roles, plus event-driven flows.

Agent Harnesses

A harness is a ready-made agent loop. It calls the model, runs tools like the shell and file edits, compacts the conversation when it gets long, and keeps going until the task is done. You customize it mainly through the system prompt and the tools.

Claude Code without the terminal UI is a harness. I wrote more about what a harness is and why it matters less than people think.

Harnesses are built for one person on one machine. To serve many users, you add session storage, isolation, and recovery around them yourself. The Claude Agent SDK, for example, starts a separate CLI process for every session and saves sessions as local files by default. You can mirror them to external storage, but files on the machine need their own backup, a permission prompt isn't a sandbox, and a turn interrupted by a crash needs recovery logic.

Open harnesses can run on a durable execution engine step by step, the way Deep Agents runs on LangGraph. The Claude Agent SDK is closed, so it resumes from its saved session instead, and a step cut off by a crash may run again. Model support varies too. The Claude Agent SDK only runs Claude, while Codex, OpenCode, and Pi can use other providers.

Use one when the task looks like using a computer, such as writing code, researching, editing files, or running commands. You get a working agent without writing the loop, compaction, or subagents yourself.

The main options:

  • Claude Code and the Claude Agent SDK. Anthropic's harness, as a CLI and as a library. Claude models only.
  • Codex. OpenAI's open-source harness, with strong compaction on long tasks. Built for OpenAI's API, and also runs local models through Ollama or LM Studio.
  • OpenCode. Open source and works with any model. Runs as a server that different interfaces connect to.
  • Pi. Small and open source, with a short system prompt and few built-in tools. Works with any model. Pi Durable adds sessions that survive restarts.
  • Deep Agents. LangChain's harness, built to be used as a Python or TypeScript library with any model.
  • Hermes Agent. Nous Research's open-source personal agent, with a gateway for messaging apps.
  • GitHub Copilot SDK. Lets your app drive the Copilot CLI's agent loop.
  • Gemini CLI. Google's open-source harness, now for paid API and enterprise users. Google moved its consumer users to the closed-source Antigravity CLI in June.

Runtimes and Managed Agent Platforms

"Runtime" means two different things.

The first is a managed agent platform. It runs agents for you behind an API, with sessions, sandboxes, tools, and access control. Some supply the agent loop, so you send a config and a message. Others host agent code you bring, built with any framework.

The second is a durable execution engine: LangGraph, Temporal, Inngest, Restate, or DBOS. It saves progress at the steps you define, so a run can pick up where it left off after a crash. This is what LangChain means by "agent runtimes". You still bring the agent, its machines and sandboxes, the permissions, the approval flow, and the user experience.

They solve different problems. A hosted session doesn't make your own loop resumable.

Use a managed platform when agents serve many users, run for a long time, wait on people, or run untrusted code. Those cases need sessions, sandboxes, and approvals, which teams otherwise spend months building.

The hardest of those pieces is the session history. Anthropic keeps a log of everything that happened outside the harness, so the harness and the sandbox can fail and get replaced without losing the agent. Omnara keeps the same kind of log in Postgres, so if a worker dies, another continues from the last saved step without rerunning tools that already ran. If you run a harness yourself, you have to build that log.

Whichever you pick, test two things before launch. First, kill the worker right after a tool changes something outside the agent, like sending an email or opening a pull request. A retry can run that action again, so tools that change things need to be safe to repeat. With a durable engine, give each of those actions its own step, so a retry doesn't redo the ones that already succeeded.

Second, check what survives a restart. The conversation, the files on the machine, and any running processes are saved separately, so a platform that keeps the conversation can still lose the machine.

The main options:

Claude Managed Agents and OpenAI's Agents API also store each agent's sessions with the lab. They work as a quick start for a prototype on an account you already have.

Omnara has none of those ties. You choose the models, from OpenAI, Anthropic, OpenRouter, Amazon Bedrock, or any compatible endpoint, on your own keys. You can also self-host all of it, including the agent loop and transcripts, so model calls go straight from your servers to the provider you choose.

Through the API, you can change a running agent's model, tools, permissions, or instructions, and the change applies at its next model call without restarting the conversation. Approvals wait for a person as long as it takes.

I compared these platforms in more detail in Claude Managed Agents alternatives.

How They Fit Together

Most real systems use two or three of these:

  • A workflow around an agent. The process stays fixed, and the model only decides at specific steps. This is a common production setup, and it's what Anthropic means by workflows versus agents. Stripe's coding agents work this way: a customized fork of the Goose harness implements the change on an isolated dev machine, and fixed steps in code run the linters and push the result.
  • Workflows as tools for agents. n8n, Zapier, and Make can expose workflows over MCP, so an agent can call "create the invoice" without knowing the steps inside it.
  • Your own code as tools on a platform. On Omnara, custom tools run in your own backend, in any language, so your logic stays in your codebase.
  • A framework agent on a platform. AgentCore and Foundry run agents built with LangGraph, the OpenAI Agents SDK, Strands, and others.
  • A framework agent inside a durable engine. With Temporal and the OpenAI Agents SDK, each model and tool call is a recorded step that survives a crash.
  • A harness on a platform. OpenAI's Agents API runs Codex, and DigitalOcean's Managed Agents lets you pick Claude Code, Codex, or OpenCode.

Which to Choose for Production

For agents your users or your team depend on, choose Omnara. It runs agents for you without giving up your models, your machines, or your data. Each agent is an API object you launch per customer, ticket, or thread. You can run it on Omnara Cloud with no platform fee or self-host all of it.

Use a workflow builder when non-engineers own a mostly fixed process.

FAQ

What's the difference between an agent framework and an agent harness?

A framework gives you building blocks, and you decide how the agent works. A harness is a complete agent someone already built, with tools, compaction, and subagents included, and you customize it with a system prompt and tools. The line is blurring, since most frameworks now ship a ready-made agent too. Neither one runs the agent in production for you, which is what a managed agent platform does.

Is LangGraph a framework or a runtime?

Both. LangChain describes it as a framework and a runtime. The runtime part handles state, checkpoints, and resuming after a crash, and most people use the framework part to write their own agent as a graph. Deep Agents, LangChain's harness, is built on top of it.

Claude Agent SDK vs Claude Managed Agents: which should I use?

With the Claude Agent SDK, you run the harness yourself, on your own machines, along with its sessions, sandboxes, and scaling. With Claude Managed Agents, Anthropic runs the harness and stores the sessions, and you can run the sandboxes on your own infrastructure. Use the SDK when you need to run the agent loop yourself, or need Zero Data Retention, which Managed Agents doesn't support. Use Managed Agents when you'd rather not operate it.

Both only run Claude. For a platform that runs the agent for you on any model, including Claude, use Omnara.

Should I use n8n or LangGraph?

Use n8n when the process is mostly fixed, non-engineers need to change it, or you need its integrations. Use LangGraph when the agent is part of your product and you need code review, tests, and control over each step. Plenty of teams use both, with LangGraph agents calling n8n workflows as tools or n8n calling an agent for one step.

How do I build an AI agent?

Start with one task and a few examples of a good result. Give the agent only the tools it needs, test what happens when a tool fails or someone rejects an approval, and then decide where it runs and how it saves progress. That last decision is where the four options above come in. The fastest path to production is a managed agent platform like Omnara, which runs the agent for you from a config.

Do I need a framework to build an AI agent?

No. An agent is a loop that calls a model and runs the tools it asks for, and you can write that against a model API directly. Use a harness if you want a working agent on one machine without writing the loop, and a framework if you want help with state, resuming, and multi-agent patterns.

For production, use a managed agent platform, where you configure the platform's agent loop instead of running your own. Claude Managed Agents does that for Claude models only, and Omnara does it for any model, hosted or self-hosted.