Skip to content

Step 08 of 22

Orchestration & agents

Chain model calls, tools and state into workflows and agents. Frameworks handle retries, state, tool calls and hand-offs. The wrong one adds abstraction you will fight later.

How to choose

  • Simple RAG or one tool call: plain SDK code may be all you need.
  • Long-running, stateful agents with human approval: a graph-based framework.
  • Visual building for non-developers: a low-code platform.

What to look for

The questions that separate the options, in order of how much they matter.

  1. 01

    Language and team fit

    Most frameworks are Python-first; TypeScript teams should look at Mastra, or at the TypeScript ports of LangGraph, the OpenAI Agents SDK and Google ADK, and check that the port has feature parity. .NET shops have one serious option in Microsoft Agent Framework. A framework your team can read and debug beats a more capable one nobody understands.

  2. 02

    Abstraction level: graph, agent loop or canvas

    Graph or state-machine frameworks (LangGraph, Microsoft Agent Framework workflows, ADK 2.0, LlamaIndex Workflows) make every step and branch explicit, which suits regulated or long-running processes. Agent-loop SDKs (OpenAI Agents SDK, Pydantic AI, smolagents, Agno) let the model choose the next tool, which is faster to build and harder to predict. Low-code canvases (Dify, n8n) let non-developers build flows but are awkward to test, review and version like code. Many teams start with a loop and move hot paths to a graph.

  3. 03

    State and durable execution

    An agent that runs for minutes or days must survive a crash or deploy without starting over. Look for checkpointing to a real database (LangGraph checkpointers, Microsoft's checkpoint storage, CrewAI's @persist, ADK's DatabaseSessionService) or integration with a durable engine such as Temporal or DBOS, as Pydantic AI offers. Check that tools are safe to re-run, because resume usually guarantees at-least-once, not exactly-once, execution.

  4. 04

    Human-in-the-loop that can wait

    Approvals before risky tool calls (sending money, deleting data, emailing customers) should be first-class: the run pauses, a person approves or edits, and the run resumes, possibly hours later on another server. Most frameworks now offer this, but it only survives restarts when combined with durable state. Test the pause-resume path early; it is where bugs cluster.

  5. 05

    Observability and evals

    You will spend more time reading traces than writing prompts. Prefer frameworks that emit OpenTelemetry or plug into tracing tools such as Langfuse, Phoenix or LangSmith, rather than only a vendor dashboard. Built-in tracing (on by default in the OpenAI Agents SDK, Logfire for Pydantic AI, Mastra's tracing and evals) is a real time-saver, as long as you can export the data.

  6. 06

    Multi-agent only when one agent fails

    Role-based crews and handoffs make good demos but multiply token use and make failures harder to trace, a complaint reviewers raise about CrewAI in particular. Start with one agent and good tools; split into several when tasks genuinely need separate context or permissions. If you do, prefer explicit handoffs or graph edges over free-form agent chat.

  7. 07

    Licence, vendor pull and release pace

    Most code frameworks are MIT or Apache 2.0, but check open-core boundaries (Mastra's ee/ folder) and fair-code or modified licences on platforms (n8n's Sustainable Use License, Dify's added conditions for multi-tenant hosting). Vendor SDKs work best with their own models and clouds. Check the release history: a framework without releases for months, as smolagents had in 2026, will lag on new model features.

How the options differ

Three families compete. Code-first graph frameworks (LangGraph, Microsoft Agent Framework, Google ADK 2.0, LlamaIndex Workflows) give you explicit control over each step, state and pause point, at the cost of more code. Lightweight agent SDKs (OpenAI Agents SDK, Pydantic AI, CrewAI, Agno, smolagents, Mastra) wrap the model-calls-tools loop with handoffs, memory and tracing and get a working agent running fastest; most have since added workflow layers for predictable paths.

Low-code platforms (Dify, n8n) put agents on a visual canvas with hosted runtimes and hundreds of integrations. They suit operations teams and internal automation, but their licences restrict reselling as a service and their flows are harder to test and review than code.

12 tools, compared

Ranked by our rating. Open any review for sources, prices and the full verdict.

Orchestration & agents tools compared
ToolRatingOur verdictBest forPrice
LangGraphrepo4.6/5Explicit control over every step an agent takes, paid for in code and learning time, and worth it once an agent must survive restarts and wait for a human.Engineering teams building long-running or multi-step agents that must be reliable and auditable.Free and open source under the MIT licence. LangSmith (tracing and deployment) is separate: Developer free for one seat, Plus $39/seat/month plus compute, Enterprise custom.
Pydantic AIrepo4.5/5Pydantic AI brings the discipline of typed Python to agents, at the cost of a release train you have to pin.Python engineers building production agents who want strong typing, testability and freedom to switch models.Free and open source under the MIT licence. Logfire observability: Personal free up to 10M records/month, Team $49/month plus $2 per extra million records. Pydantic AI Gateway adds a 5% markup on built-in providers.
Difyrepo4.5/5Dify gives business teams a complete LLM app builder they can edit themselves, on a licence that only bites when you resell it as a hosted service.Teams building internal chatbots and RAG apps that non-engineers will maintain.Self-hosted Community Edition free (modified Apache 2.0, one workspace). Dify Cloud: Sandbox free (200 one-time message credits), Professional $590/workspace/year, Team $1,590/workspace/year (annual billing, which Dify says saves 17%), Enterprise by quote.
OpenAI Agents SDKrepo4.4/5A small, readable agent SDK whose defaults quietly assume OpenAI: tracing ships your runs to its dashboard, and the local sandbox trusts your machine.Developers building agents mainly on OpenAI models who want a minimal, well-documented SDK.Free and open source under the MIT license. You pay for model usage.
Mastrarepo4.4/5TypeScript's most complete agent toolkit, released at a pace that rewards teams who pin versions and read changelogs.TypeScript and Next.js teams building agents and AI workflows.Core is free under Apache 2.0; code in ee/ folders needs a Mastra Enterprise licence in production. Mastra's hosted platform: Starter $0, Teams $250/month, Enterprise custom; self-hosted Enterprise is a flat annual fee.
n8nrepo4.4/5Wide reach for wiring AI steps into business systems at a flat self-hosted cost, offset by a security patch cadence no self-hoster can ignore.Ops and engineering teams automating business processes that include AI steps.Fair-code: Community Edition free to self-host under the Sustainable Use License. Billed annually: Cloud Starter €20/month (2,500 executions), Pro €50/month (10,000); self-hosted Business €667/month (40,000); Enterprise custom.
LlamaIndexrepo4.3/5Still a deep toolkit for document-heavy RAG, but its maker now says plainly that the framework is no longer its priority.Python developers building RAG or document agents over large, varied data sources.Framework free under MIT. LlamaParse (paid cloud): Free with 10k credits, Starter $50/month (40k credits), Pro $500/month (400k credits), Enterprise custom; 1,000 credits = $1.25.
Google Agent Development Kit (ADK)repo4.2/5A serious, fast-moving agent framework whose shortest road always leads to Gemini and Google Cloud, which is either the point or the catch.Teams building agents on Gemini or deploying to Google Cloud.Free and open source under the Apache 2.0 licence. You pay for the models and Google Cloud services you use.
Microsoft Agent Frameworkrepo4.2/5The obvious home for .NET and Azure teams building agents, and a capable but less proven choice for Python teams elsewhere..NET and Azure teams, and anyone migrating from AutoGen or Semantic Kernel.Free and open source under the MIT licence. You pay only for the models and Azure services you use.
CrewAIrepo4.1/5Fast to a working multi-agent demo and harder to steer the further it travels from one, so production teams end up writing Flows rather than Crews.Python developers who want a multi-agent workflow running quickly and can accept less low-level control.Free and open source under the MIT licence. CrewAI AMP: Basic free with 50 workflow executions a month; Enterprise (more executions, SSO, RBAC, VPC or on-prem deployment) by quote.
Agnorepo4.1/5Agno turns a Python agent into a served API with very little glue, but that API ships with authentication switched off.Python teams that want to run production agents on their own infrastructure with minimal plumbing.Framework and AgentOS free under Apache 2.0. Control plane: free against a local AgentOS; Pro $150/month (one live connection, three seats, extra seats $30, SAML SSO $300); Enterprise custom.
smolagentsrepo3.5/5A clear demonstration that agents can act in code, now drifting into maintenance mode with 590 pull requests waiting.Researchers and learners exploring code-writing agents, especially with open models.Free and open source under the Apache 2.0 license.

Side by side

The specifications that matter for this step. Checked 2026-10-19; confirm on the vendor’s site before you commit.

Orchestration & agents: specifications side by side
ToolLanguageAbstractionState / durabilityHuman-in-the-loopMulti-agentLicence
LangGraphPython; separate JS/TS libraryGraph / state machineCheckpoints every stepFirst-class interruptsYes, as graph nodesMIT
Pydantic AIPythonTyped agent loopTemporal, DBOS, PrefectYes (tool approval)Fewer prebuilt patternsMIT
DifyLow-code (Python backend)Visual canvasPaused runs via workersYes (Human Input node)Via workflowsModified Apache 2.0
OpenAI Agents SDKPython; separate TS repoAgent loop with handoffsSessions; durable approvalsYes (approvals)Yes, handoffsMIT
MastraTypeScriptAgents plus typed workflowsMemory; suspend and resumeYes (workflow suspend)Yes, supervisor agentsApache 2.0 (ee/ commercial)
n8nLow-code (TS backend)Visual workflow automationStored executionsYes (tool-call review)Via sub-workflowsSustainable Use (fair-code)
LlamaIndexPython, TypeScriptEvent-driven workflowsSerialisable contextYes (input events)Yes (AgentWorkflow)MIT
Google Agent Development Kit (ADK)Python, TS, Go, JavaAgents plus graph (2.0)Database sessions; resumeYes (tool confirmation)YesApache 2.0
Microsoft Agent FrameworkPython, .NETAgents plus graph workflowsCheckpoint storageYes (request/response)YesMIT
CrewAIPythonRole crews plus Flows@persist (SQLite default)Yes (@human_feedback)Yes, core designMIT
AgnoPythonAgent loop plus AgentOSSessions in your databaseYes (approval pauses)Yes, teamsApache 2.0
smolagentsPythonCode-writing agent loopIn-process memory onlyVia step callbacksYes (managed agents)Apache 2.0

Where this stage fits

Sources for this guide