Skip to main content

n8n vs LangGraph: Automation Platform or Agent Framework?

n8n vs LangGraph: when a workflow platform beats an agent framework, when it does not, and the hybrid pattern where n8n calls a LangGraph service over HTTP.

Founder of IImagined.ai

Published
Oct 11, 2026
Reading time
12 min read
Quick answer

n8n vs LangGraph is a platform against a framework. Use n8n when the job is triggers, app integrations and a contained AI step: its AI Agent node runs the tool loop for you. Use LangGraph when the agent's own control flow is the hard part: loops, branches on state, pauses mid-run, all in Python or TypeScript. When you need both, let n8n trigger and deliver while a LangGraph service does the reasoning, called from an HTTP Request node.

n8n vs LangGraph is not a like-for-like choice: n8n is a workflow automation platform you configure on a canvas, and LangGraph is a code library for building stateful AI agents. Use n8n when the job is mostly triggers, app integrations and a contained AI step; use LangGraph when the agent's own control flow is the hard part; and use both when you need the two at once, with n8n calling a LangGraph service over HTTP.

A documentation-based comparison, not a benchmark. Checked on 11 October 2026 against the LangGraph docs (overview, persistence, interrupts, local server), the Agent Server docs and its OpenAPI specification, the LangGraph releases and licence, LangSmith pricing, n8n's docs on LangChain in n8n, the AI Agent node and human review for tools, the n8n pricing page, and the source of n8n 2.42.6.

The two get compared because both can produce "an AI agent". They get there from opposite ends. n8n starts with the plumbing, a webhook, a CRM, a spreadsheet, and lets you drop an agent into it. LangGraph starts with the agent's reasoning and leaves the plumbing to you. This page gives you a decision tree, the head-to-head facts, and a working example of the hybrid. It belongs to our n8n hub; for what makes a workflow agentic in the first place, start with agentic AI workflows.

n8n or LangGraph for AI agents: the decision tree

Answer the questions in order and stop at the first one that settles it. The first two send most projects to n8n. The next three are the real reasons to pick up a framework.

Seven questions, in order
  1. 1
    Is the job mostly moving data between apps on a trigger?

    Yes: n8n. A form, a CRM, a sheet and a chat tool are its home ground, and the AI step is one node among many.

  2. 2
    Is the AI part one model call, or one agent with a few tools?

    Yes: n8n. The AI Agent node runs the tool loop for you, up to 10 iterations by default.

  3. 3
    Must the agent loop, branch or retry on its own state?

    Yes: LangGraph. Draft, review, revise is one conditional edge in a graph and a tangle of If nodes on a canvas.

  4. 4
    Does a run pause for a person and resume later, mid-step?

    Approving a tool call: n8n covers it. Pausing anywhere with the full state saved: LangGraph interrupts.

  5. 5
    Do you want tests, code review and version control on the agent logic?

    Yes: LangGraph. It is ordinary Python or TypeScript in your repository.

  6. 6
    Can someone on the team write and run a small web service?

    No: stay in n8n and keep the agent simple. A framework nobody can maintain is worse than a canvas with limits.

  7. 7
    Does the agent also need many app integrations around it?

    Yes to this and to question 3: use both. n8n triggers and delivers, LangGraph reasons in between.

Where each one fits
Many app integrations
n8n. Classic automation with an AI step inside it.
Both. n8n handles triggers and apps; a LangGraph service handles the reasoning.
Few app integrations
Either, or a plain script. Pick what the team already runs.
LangGraph. The agent is the product and the integrations are a few API calls.
Steps are known in advance
The agent decides the steps

n8n vs LangGraph head to head

n8nLangGraph
What it isWorkflow automation platform with a visual editorCode library and runtime for stateful agents
How you buildConnect nodes on a canvas; code is optionalWrite Python or TypeScript: state, nodes and edges
LicenceSustainable Use License (source-available)MIT
Latest release2.42.6, released 9 October 2026langgraph 1.2.14 on PyPI, released 6 October 2026
App integrationsHundreds of app nodes with stored credentialsNone built in; you call APIs or LangChain integrations from code
TriggersWebhook, schedule, chat, form and app-event triggersNone in the library; Agent Server adds an HTTP API, cron jobs and webhooks
Agent loopInside the AI Agent node: the model calls tools until done, 10 iterations by defaultYou draw it: any cycle, branch or hand-off, as edges in a graph
StateChat history through a memory sub-node, plus the items passed between nodesA typed state object you define, checkpointed at each step
Pause for a personA human review step on chosen tools: approve or denyinterrupt() anywhere in a node; resume later with a value
After a crashOpen the failed execution and retry itWith a checkpointer, a run resumes from its last checkpoint
Hostingn8n Cloud, or self-hosted with DockerYour own service, or LangSmith Deployment
TracingExecution log per run; LangSmith tracing on self-hosted n8n onlyLangSmith tracing from two environment variables
Price (checked October 2026)Community Edition free; Cloud from €20 a month billed annuallyLibrary free; LangSmith Plus $39 per seat a month with one small deployment

Two rows carry most of the weight. State: in n8n an agent remembers through a memory sub-node that stores chat history, while in LangGraph the state is whatever structure you define, saved after every step. Agent loop: n8n gives you one well-built loop, and LangGraph gives you the parts to build any loop.

What n8n gives an agent

In n8n an agent is a node. You connect a chat model, optional memory and at least one tool to the AI Agent node, and it decides which tools to call. Since n8n 1.82 every AI Agent node works as a Tools Agent; the older agent types are deprecated and the docs say version 1 of the node goes in n8n 3.0. n8n also has a separate Agents feature, where an agent is built from a model, instructions and tools without a canvas; n8n labels it Preview, so this comparison uses the AI Agent node.

  • Tools from the app library. App nodes, an HTTP request, another workflow or an MCP server can all be attached as tools, using credentials you have already stored.
  • Memory as a sub-node. Simple Memory, Postgres or Redis chat memory keep the conversation. Our n8n AI agent memory guide builds all three tiers.
  • Human review for tools. A tool can require approval through Chat, Slack or another channel before it runs. The reviewer can approve or deny.
  • Everything around the agent. Triggers, retries, error workflows and delivery to the apps where people work.

The limits follow from the same design. The loop lives inside the node, so you set a system message and a maximum number of iterations, not the path. Memory is chat history, not arbitrary state. Chains cannot use memory at all. And a multi-step cycle such as "draft, check, redo until good" has to be drawn with If and loop nodes around the agent, which works for one cycle and gets hard to read by the third.

Price, checked October 2026: the self-hosted Community Edition is free; Cloud Starter is €20 a month billed annually for 2,500 executions, and its feature list includes agents, MCP and AI nodes. One chat turn or one webhook call is one execution. Model tokens are billed by your model provider on top.

What LangGraph gives an agent

LangGraph's docs describe it as "a low-level orchestration framework and runtime for building, managing, and deploying long-running, stateful agents". You define a state type, write node functions that read and update it, and connect them with edges, including conditional edges that route on the state. It is MIT-licensed, ships for Python and TypeScript, and reached version 1.2.14 on 6 October 2026.

  • Any control flow. Cycles, branches, parallel workers and sub-graphs are first-class, and deterministic steps mix with model-driven ones in the same graph.
  • Persistence. A checkpointer saves the state of each thread at every step. An in-memory saver is for tests; the docs point to Postgres or SQLite for anything that must survive a restart.
  • Interrupts. Calling interrupt() inside a node saves the state and waits, indefinitely, until you resume the same thread with a value.
  • A server when you want one. Agent Server wraps your graphs in an HTTP API with threads, background runs, cron jobs and completion webhooks, and handles persistence itself.

What it does not give you is anything outside the agent. There is no Gmail node and no credential store. Every integration is a function you write or a LangChain package you add. The docs are candid that it is "very low-level", and they send people who want a ready-made tool-calling loop to LangChain's higher-level agents instead.

The short version
Pick n8n if
  • The agent sits inside a wider app-to-app automation
  • One agent with a handful of tools does the job
  • Operations staff must read and adjust the workflow
  • You want triggers, retries and alerts without writing them
  • Approvals are about whether a tool may run
  • Nobody wants to deploy and monitor another service
Pick LangGraph if
  • The agent loops, branches or hands off on its own state
  • Runs last minutes or hours and must survive a restart
  • A person edits the state mid-run, then the agent continues
  • You need unit tests and code review on the logic
  • Several agents or sub-graphs cooperate
  • The agent is the product, not a step in a workflow

n8n vs LangChain: is n8n the same thing underneath?

Partly. The n8n docs state that its AI nodes "implement LangChain's JavaScript framework", and they publish a table mapping LangChain concepts to nodes: chains and agents become root nodes, while models, memory, tools, retrievers and output parsers become sub-nodes. So an n8n AI Agent is a LangChain agent with a visual wrapper.

That does not make n8n a LangGraph front end. In LangChain's own description, LangChain is the agent framework and LangGraph is the orchestration runtime beneath it. n8n exposes the first layer. Custom graph state, checkpoints you can rewind and interrupts in the middle of a node are LangGraph features with no n8n node. The escape hatch inside n8n is the LangChain Code node, which runs LangChain JavaScript you write yourself; by the time you need it often, a separate service is usually cleaner.

The hybrid pattern: n8n triggers, LangGraph thinks

The pattern that holds up is a split by strength. n8n owns everything that touches other systems. LangGraph owns the reasoning. They meet at one HTTP call.

One request through both tools
  1. 01
    n8n trigger

    A webhook, schedule, form or app event starts the workflow.

  2. 02
    n8n gathers context

    App nodes fetch the ticket, the customer record and anything else the agent needs.

  3. 03
    HTTP Request to LangGraph

    POST /runs/wait with the assistant name and the input as JSON.

  4. 04
    LangGraph runs the graph

    Draft, review, revise: it loops on its own state until the reviewer says send.

  5. 05
    Final state comes back

    The response body is the graph output: draft, verdict and revision count.

  6. 06
    n8n delivers

    Post to the helpdesk, ask for sign-off in Slack, log a row, alert on failure.

Here is a working example. The graph is the evaluator and optimizer pattern from the LangGraph docs, pointed at support tickets: one model call writes a reply, a second grades it, and a conditional edge sends it back for another pass, three at most.

from typing import Literal
from typing_extensions import TypedDict
from pydantic import BaseModel, Field
from langchain_anthropic import ChatAnthropic
from langgraph.graph import StateGraph, START, END

llm = ChatAnthropic(model="claude-sonnet-5-5")


class State(TypedDict):
    ticket: str
    draft: str
    feedback: str
    verdict: str
    revisions: int


class Review(BaseModel):
    verdict: Literal["send", "revise"] = Field(
        description="send if the reply fully answers the ticket, otherwise revise"
    )
    feedback: str = Field(description="What to fix when the verdict is revise")


reviewer = llm.with_structured_output(Review)


def write_draft(state: State):
    prompt = f"Write a short, polite reply to this support ticket:\n{state['ticket']}"
    if state.get("feedback"):
        prompt += f"\nFix this in your previous draft: {state['feedback']}"
    msg = llm.invoke(prompt)
    return {"draft": msg.content, "revisions": state.get("revisions", 0) + 1}


def review_draft(state: State):
    review = reviewer.invoke(
        f"Ticket:\n{state['ticket']}\n\nDraft reply:\n{state['draft']}"
    )
    return {"verdict": review.verdict, "feedback": review.feedback}


def next_step(state: State):
    if state["verdict"] == "send" or state["revisions"] >= 3:
        return "done"
    return "retry"


builder = StateGraph(State)
builder.add_node("write_draft", write_draft)
builder.add_node("review_draft", review_draft)
builder.add_edge(START, "write_draft")
builder.add_edge("write_draft", "review_draft")
builder.add_conditional_edges(
    "review_draft", next_step, {"done": END, "retry": "write_draft"}
)
graph = builder.compile()

Save it as src/agent/graph.py in a project made with langgraph new, and name the graph in langgraph.json:

{
  "dependencies": [
    "."
  ],
  "graphs": {
    "agent": "./src/agent/graph.py:graph"
  },
  "env": "./.env"
}

langgraph dev then starts Agent Server on http://127.0.0.1:2024. The docs describe this mode as in-memory and meant for development. On the n8n side, three nodes are enough: paste this JSON onto an empty canvas.

{
  "name": "Ticket in, LangGraph draft out",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "ticket-draft",
        "responseMode": "lastNode",
        "options": {}
      },
      "id": "a7c1e2d4-0001-4b6f-9c3a-000000000001",
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2.1,
      "position": [
        0,
        0
      ],
      "webhookId": "a7c1e2d4-1000-4b6f-9c3a-000000000010"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "http://127.0.0.1:2024/runs/wait",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\n  \"assistant_id\": \"agent\",\n  \"input\": { \"ticket\": {{ JSON.stringify($json.body.ticket) }} }\n}",
        "options": {
          "timeout": 120000
        }
      },
      "id": "a7c1e2d4-0002-4b6f-9c3a-000000000002",
      "name": "Run LangGraph agent",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        240,
        0
      ]
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "a7c1e2d4-2000-4b6f-9c3a-000000000020",
              "name": "draft",
              "value": "={{ $json.draft }}",
              "type": "string"
            },
            {
              "id": "a7c1e2d4-2000-4b6f-9c3a-000000000021",
              "name": "verdict",
              "value": "={{ $json.verdict }}",
              "type": "string"
            },
            {
              "id": "a7c1e2d4-2000-4b6f-9c3a-000000000022",
              "name": "revisions",
              "value": "={{ $json.revisions }}",
              "type": "number"
            }
          ]
        },
        "options": {}
      },
      "id": "a7c1e2d4-0003-4b6f-9c3a-000000000003",
      "name": "Shape reply",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        480,
        0
      ]
    }
  ],
  "connections": {
    "Webhook": {
      "main": [
        [
          {
            "node": "Run LangGraph agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Run LangGraph agent": {
      "main": [
        [
          {
            "node": "Shape reply",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  }
}
Get the example running
  • Install the CLI with pip install -U "langgraph-cli[inmem]" (Python 3.11 or later) and create a project with langgraph new
  • Replace the template graph with the code above and add langchain-anthropic to the project dependencies
  • Put ANTHROPIC_API_KEY in .env, and change the model name to one your key can use
  • Run langgraph dev and open the Studio link it prints to confirm the graph loads
  • Import the n8n workflow; if n8n runs in Docker, replace 127.0.0.1 with an address the container can reach
  • Select Listen for test event on the Webhook node and POST {"ticket": "My invoice is wrong"} to the test URL
  • Expected result: a JSON reply with draft, verdict and revisions, and one execution in n8n

What was checked: the Python follows the syntax of the LangGraph 1.x docs, the endpoint and body fields come from the Agent Server OpenAPI specification, and the n8n node types, versions and parameter names come from the n8n 2.42.6 source. Neither file was executed for this article, so treat the first run as a test.

Three production notes. A deployment on LangSmith expects a LangSmith API key in the x-api-key header, so store it as a Header Auth credential in n8n instead of typing it into the node. A self-hosted Agent Server has no authentication by default, per the docs, so do not expose it without your own. And give the n8n workflow an error workflow before it goes live; our Error Trigger guide has one ready to import.

What each side costs

Neither tool is the expensive part. The table lists what each piece costs to run, from the vendors' published prices.

PiecePrice (checked October 2026)Notes
n8n Community EditionNo licence fee, no execution capYou pay for the server and your upkeep time
n8n Cloud Starter€20 a month billed annually for 2,500 executionsOne webhook call is one execution, however long the graph thinks
LangGraph library$0, MITPython 3.10 or later, or the TypeScript package
LangSmith Developer$0, one seat, up to 5,000 base traces a monthTracing and evaluation; no Deployment
LangSmith Plus$39 per seat a month, up to 10,000 base tracesAdds Deployment: one free small serverless deployment, more metered in units of $1.00
Standalone Agent ServerCustomNeeds Postgres, Redis and a LangSmith licence key; self-hosting sits under the Enterprise plan
Your own web serviceServer cost onlyAny web framework can wrap a compiled graph; persistence and auth are then yours to build
Model tokensBilled by the model providerThe same on both sides, and usually the largest line

One thing the hybrid does to an n8n bill is hide work: a graph that calls the model eight times still counts as a single n8n execution, because n8n only sees one HTTP request. The tokens do not hide. Our LLM API pricing comparison has current per-token rates.

Alternatives between the two

  • Visual agent builders. Langflow sits closer to LangGraph's concepts while staying on a canvas. Our AI agent builder comparison covers it next to n8n, and notes what happened to Flowise.
  • LangChain's prebuilt agents. If you want code but not graph design, the LangGraph docs themselves recommend starting there.
  • A plain SDK loop. A model API with tool use and a while loop covers many agents without a framework.
  • Other workflow platforms. If the n8n half is the part you are unsure of, n8n alternatives compares twelve.

That third option is where our own material sits. The AI SaaS Builder program has no n8n or LangGraph lessons; it teaches the layer both are built on, with the Claude API for tool use and structured output, MCP servers, a research agent built step by step, and the Supabase, Vercel and Stripe work that turns an agent into something people pay for.

n8n vs LangGraph: FAQ

Is LangGraph better than n8n for AI agents?

For agents whose own control flow is the hard part, yes. LangGraph lets you define state, loops, branches and pause points in code, and it checkpoints every step. For an agent that is one model with a few tools inside a wider business automation, n8n is faster to build and easier to hand over, because the AI Agent node runs the tool loop and the app integrations are already there.

Is n8n built on LangChain?

Its AI nodes are. The n8n docs say they implement LangChain's JavaScript framework, and they map LangChain concepts such as chains, agents, memory, tools and vector stores to n8n nodes. The rest of n8n, including triggers, app nodes and the execution engine, is n8n's own. n8n does not expose LangGraph features such as custom graph state, checkpoints or interrupts.

Can n8n call a LangGraph agent?

Yes, over HTTP. Run the graph behind LangGraph's Agent Server, or behind your own web service, and call it from an HTTP Request node. With Agent Server, a POST to /runs/wait with the assistant name and an input object runs the graph and returns its final output in the response. Deployments on LangSmith expect a LangSmith API key in the x-api-key header.

Is LangGraph free?

The library is free and MIT-licensed. Running it is your cost: a server for your own service, plus the model tokens. LangChain's managed option, LangSmith Deployment, needs the Plus plan at $39 per seat a month, which includes one small serverless deployment, with further usage metered. The free Developer plan covers tracing only. Checked October 2026 on langchain.com/pricing.

Do I need to code to use LangGraph?

Yes. LangGraph is a Python and TypeScript library: you write the state, the node functions and the edges, then run and deploy it like any other service. Its own docs call it very low-level. If nobody on the team writes and maintains code, build the agent in n8n instead and accept the simpler control flow.

Can LangGraph replace n8n?

Not by itself. LangGraph has no app connectors, no credential store and no triggers in the library; Agent Server adds an HTTP API, cron jobs and completion webhooks, but every integration is still code you write. Teams that drop n8n for LangGraph end up rebuilding webhooks, schedules, retries and app logins. Keeping n8n for those and LangGraph for the reasoning is usually less work.

All Access · all four programs · $99/mo

Picked the tool? Learn the layer underneath it.

AI SaaS Builder, included in All Access, covers what both n8n and LangGraph sit on: Claude API tool use and structured output, MCP servers, and a research agent built step by step, then Supabase, Vercel and Stripe to ship it as a product. It has no n8n or LangGraph lessons. The other three programs, weekly coaching and the community come with the same subscription.

Start All Access — $99/mo →30-day money-back guarantee
Free

Unsure which side your agent belongs on?

Describe the trigger, the tools and the loop in the free Discord and compare notes with people running n8n agents and code agents side by side.