Langflow

Langflow logo

Release Notes PyPI - License PyPI - Downloads Twitter YouTube Channel Discord Server Ask DeepWiki

Langflow is a powerful platform for building and deploying AI-powered agents and workflows. It provides developers with both a visual authoring experience and built-in API and MCP servers that turn every workflow into a tool that can be integrated into applications built on any framework or stack. Langflow comes with batteries included and supports all major LLMs, vector databases and a growing library of AI tools.

Highlight features

Langflow Desktop

Langflow Desktop is the easiest way to get started with Langflow. All dependencies are included, so you don’t need to manage Python environments or install packages manually. Available for Windows and macOS.

Download Langflow Desktop

Quickstart

Install locally

Requires Python 3.10 to 3.13 and uv as the recommended package manager.

Install

From a fresh directory, run:

uv pip install langflow -U

Run

uv run langflow run

Langflow starts at http://127.0.0.1:7860.

Other install options

Run from source

If you cloned this repository and want to contribute, run this command from the repository root:

make run_cli

For more details, see DEVELOPMENT.md.

Docker

Start a Langflow container with default settings:

docker run -p 7860:7860 langflowai/langflow:latest

Langflow is then available at http://localhost:7860/.

For configuration options, deployment guides, and environment variables, see the docs/, docker/, and deploy/ directories.


Technical architecture guide

This section provides a technical overview of Langflow’s architecture, repository structure, runtime model, development workflow, deployment, persistence, and scaling considerations.

Table of contents


System objective

Langflow is an AI-first platform for:

A central design idea in the repository is that saved flows are persistent production artifacts. This makes compatibility and stable serialization important across the whole system.


Architectural overview

Langflow is organized as a layered system:

  1. Frontend
    • visual editor
    • flow management
    • playground
    • interaction UX
  2. Backend platform
    • FastAPI server
    • auth
    • persistence
    • API layer
    • services and lifecycle
  3. Runtime core
    • graph execution
    • component model
    • built-in components
    • execution primitives
  4. Distribution
    • integrated package that ships frontend, backend, and runtime together

The repository guidance also describes the stack this way:


Repository structure

High-level layout:

langflow/
├── src/
│   ├── backend/
│   │   └── base/langflow/
│   ├── frontend/
│   ├── lfx/
│   └── sdk/
├── docs/
├── deploy/
├── docker/
├── docker_example/
├── scripts/
├── Makefile
├── Makefile.frontend
├── pyproject.toml
├── package.json
├── uv.lock
└── .env.example

Important files:


Architecture by layer

Frontend

Location:

Technology:

Frontend responsibilities include:

Frontend entrypoint:

The frontend is developed separately, but in the final product build it is copied into the backend package and served from there.


Backend platform layer

Location:

This layer contains:

Responsibilities include:

Observed startup options include:

This shows the backend is designed to run as a configurable server process.


Runtime execution core lfx

Location:

This is the execution engine and component framework.

It contains:

Responsibilities include:

The lfx.components package includes many categories of integrations, including:


Distribution layer

The langflow package ties everything together.

It packages:

This enables the whole product to be started with a unified command:

uv run langflow run

This gives Langflow a packaged product distribution model instead of requiring users to manually run separate services.


Technical architecture diagram

                                      ┌──────────────────────┐
                                      │      End Users       │
                                      │  Browser / API / MCP │
                                      └──────────┬───────────┘
                                                 │
                           ┌─────────────────────┼─────────────────────┐
                           │                     │                     │
                           ▼                     ▼                     ▼
                 ┌────────────────┐   ┌────────────────────┐  ┌───────────────────┐
                 │ React Frontend │   │ External API Users │  │   MCP Clients      │
                 │ Canvas and UX  │   │ Trigger flows      │  │ Consume tools      │
                 └───────┬────────┘   └──────────┬─────────┘  └─────────┬─────────┘
                         │                       │                      │
                         └──────────────┬────────┴──────────────┬──────┘
                                        ▼                       ▼
                           ┌────────────────────────────────────────────┐
                           │        Langflow Platform Backend           │
                           │--------------------------------------------│
                           │ FastAPI routes                             │
                           │ Auth and API keys                          │
                           │ Flow persistence                           │
                           │ Services and lifecycle                     │
                           │ Database and storage services              │
                           │ File and env handling                      │
                           │ Deployment endpoints                       │
                           └─────────────────┬──────────────────────────┘
                                             │ invokes and delegates
                                             ▼
                           ┌────────────────────────────────────────────┐
                           │              lfx Runtime Core              │
                           │--------------------------------------------│
                           │ Graph execution                            │
                           │ Component model                            │
                           │ Built-in components                        │
                           │ Agent and model adapters                   │
                           │ Tool and vector store adapters             │
                           │ Flow controls                              │
                           │ CLI execution                              │
                           └─────────────────┬──────────────────────────┘
                                             │
                   ┌─────────────────────────┼──────────────────────────────┐
                   │                         │                              │
                   ▼                         ▼                              ▼
        ┌──────────────────┐     ┌──────────────────────┐      ┌──────────────────────┐
        │ LLM Providers    │     │ Vector Databases     │      │ External Tools and   │
        │ OpenAI Anthropic │     │ Chroma Pinecone etc  │      │ APIs                 │
        └──────────────────┘     └──────────────────────┘      └──────────────────────┘

Detailed ascii diagrams

Package dependency relationships

                          ┌───────────────────────────────┐
                          │          langflow             │
                          │   distribution and app        │
                          └──────────────┬────────────────┘
                                         │
                   ┌─────────────────────┼─────────────────────┐
                   │                     │                     │
                   ▼                     ▼                     ▼
      ┌──────────────────────┐  ┌──────────────────────┐  ┌──────────────────────┐
      │   src/frontend       │  │ langflow-base        │  │        lfx           │
      │ React and TS UI      │  │ backend platform     │  │ runtime core         │
      └──────────┬───────────┘  └──────────┬───────────┘  └──────────┬───────────┘
                 │                         │                         │
                 │ HTTP and API           imports                   exposes
                 │                         │                         │
                 ▼                         ▼                         ▼
      ┌──────────────────────┐  ┌──────────────────────┐  ┌──────────────────────┐
      │ Browser runtime      │  │ FastAPI auth DB      │  │ Components and graph │
      │ Canvas playground    │  │ Services migrations  │  │ Engine and CLI       │
      └──────────────────────┘  └──────────────────────┘  └──────────────────────┘

Local startup flow

Developer
   │
   ├── make init
   │      │
   │      ├── check tools such as uv and npm
   │      ├── install Python dependencies
   │      ├── install frontend dependencies
   │      └── validate environment
   │
   ├── uv run langflow run
   │      │
   │      ├── parse CLI args
   │      ├── load env file
   │      ├── initialize backend services
   │      ├── initialize database and storage services
   │      ├── load configured custom components path
   │      ├── initialize API and server lifecycle
   │      └── serve embedded frontend and backend APIs
   │
   └── Browser opens local Langflow instance

Flow creation and save lifecycle

┌──────────────┐
│ User in UI   │
└──────┬───────┘
       │ drag and drop nodes
       ▼
┌──────────────────────┐
│ Frontend canvas      │
│ local graph state    │
└──────┬───────────────┘
       │ edit config and connect edges
       ▼
┌──────────────────────┐
│ Frontend serializer  │
│ graph to flow JSON   │
└──────┬───────────────┘
       │ save request
       ▼
┌──────────────────────┐
│ Backend API          │
│ validate and persist │
└──────┬───────────────┘
       │
       ▼
┌──────────────────────┐
│ Database or storage  │
│ persisted flow       │
└──────────────────────┘

Flow execution lifecycle

┌──────────────┐
│ User API MCP │
└──────┬───────┘
       │ execute flow
       ▼
┌────────────────────────────┐
│ Backend route or service   │
│ resolve flow and inputs    │
└──────────┬─────────────────┘
           │
           ▼
┌────────────────────────────┐
│ Load persisted flow JSON   │
└──────────┬─────────────────┘
           │ map to runtime graph
           ▼
┌────────────────────────────┐
│ lfx graph execution engine │
└──────────┬─────────────────┘
           │
           ├── instantiate components
           ├── resolve dependencies
           ├── evaluate control flow
           ├── call models tools vector DBs
           └── collect outputs
           │
           ▼
┌────────────────────────────┐
│ Execution result           │
│ data message response      │
└──────────┬─────────────────┘
           │
           ▼
┌────────────────────────────┐
│ Backend response adapter   │
└──────────┬─────────────────┘
           │
           ▼
┌────────────────────────────┐
│ UI playground or API caller│
└────────────────────────────┘

Runtime component resolution

Execution request
      │
      ▼
Need component X
      │
      ├── Is X already known in dynamic imports
      │       │
      │       ├── Yes -> import directly
      │       └── No
      │
      ▼
Scan undiscovered component modules
      │
      ├── import module lazily
      ├── inspect module dynamic imports
      ├── register discovered components
      └── cache discovered module
      │
      ▼
Resolve concrete component class
      │
      ├── module import
      ├── alias module fallback if needed
      ├── detect missing dependency errors
      └── cache in globals
      │
      ▼
Instantiate component and execute

Custom component loading flow

Developer creates Python component
        │
        ▼
┌─────────────────────────────┐
│ Custom component source     │
│ class Component or Custom   │
└──────────┬──────────────────┘
           │
           ▼
┌─────────────────────────────┐
│ components_path             │
│ configured in CLI or env    │
└──────────┬──────────────────┘
           │
           ▼
┌─────────────────────────────┐
│ Backend custom loader       │
│ langflow.custom or lfx.custom│
└──────────┬──────────────────┘
           │ validate build register
           ▼
┌─────────────────────────────┐
│ Runtime component catalog   │
└──────────┬──────────────────┘
           │
           ▼
┌─────────────────────────────┐
│ Available in UI and runtime │
└─────────────────────────────┘

Frontend backend build pipeline

┌──────────────────────┐
│ src/frontend         │
│ React and TS source  │
└──────────┬───────────┘
           │ npm run build
           ▼
┌──────────────────────┐
│ src/frontend/build   │
│ static assets        │
└──────────┬───────────┘
           │ copy
           ▼
┌────────────────────────────────────┐
│ src/backend/base/langflow/frontend │
│ embedded UI served by backend      │
└──────────┬─────────────────────────┘
           │ included in package app
           ▼
┌──────────────────────┐
│ langflow distribution│
└──────────────────────┘

Logical production deployment

                    ┌────────────────────────────┐
                    │        End Users           │
                    │ Browser API MCP calls      │
                    └─────────────┬──────────────┘
                                  │
                                  ▼
                    ┌────────────────────────────┐
                    │ Load Balancer or Reverse   │
                    │ Proxy optional             │
                    └─────────────┬──────────────┘
                                  │
                  ┌───────────────┼────────────────┐
                  │               │                │
                  ▼               ▼                ▼
      ┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
      │ Langflow node 1 │ │ Langflow node 2 │ │ Langflow node N │
      │ Backend and UI  │ │ Backend and UI  │ │ Backend and UI  │
      └────────┬────────┘ └────────┬────────┘ └────────┬────────┘
               │                   │                   │
               └────────────┬──────┴────────────┬──────┘
                            ▼                   ▼
                 ┌──────────────────┐   ┌──────────────────┐
                 │ PostgreSQL       │   │ File or blob     │
                 │ relational state │   │ storage if used  │
                 └────────┬─────────┘   └────────┬─────────┘
                          │                      │
                          └──────────┬───────────┘
                                     ▼
                     ┌────────────────────────────────┐
                     │ External AI infrastructure     │
                     │ LLM APIs vector DBs tools      │
                     └────────────────────────────────┘

Persistence architecture

Persistence in Langflow lives primarily in the backend platform layer.

The platform explicitly registers and uses services such as:

This means persistence is not treated as a single monolithic concern. Instead, the repository models different kinds of persisted state separately.

Main persistence categories

Relational persistence

This is where Langflow stores structured application state such as:

PostgreSQL is explicitly supported in the repository, including:

File and blob persistence

The presence of a storage_service strongly suggests a separate layer for:

Variable and state persistence

Additional services indicate the system also models:

PostgreSQL support

The repository shows direct evidence of PostgreSQL support:

So the most accurate statement is:

Langflow uses the backend platform layer for persistence, and PostgreSQL is an explicitly supported relational persistence backend.


Persistence diagram

React Frontend
      │
      ▼
Langflow Backend Platform
      │
      ├── database_service ─────────► PostgreSQL
      │        │
      │        ├── flows
      │        ├── users
      │        ├── sessions
      │        ├── build metadata
      │        └── transactional state
      │
      ├── storage_service ──────────► file blob object storage
      │
      ├── variable_service ─────────► persisted variables and config
      │
      ├── state_service ────────────► application or runtime state
      │
      ├── session_service ──────────► user and run session state
      │
      ├── store_service ────────────► general storage abstractions
      │
      └── transaction_service ──────► transaction coordination

Persistence flow example

User saves flow
    │
    ▼
Frontend serializes graph
    │
    ▼
Backend API validates flow
    │
    ▼
database_service writes structured record
    │
    ├── flow definition and metadata -> PostgreSQL
    └── associated files if any      -> storage_service

Scaling architecture without Celery

Langflow supports a local execution model without Celery.

In this mode, the platform uses:

                    ┌────────────────────────────┐
                    │        End Users           │
                    │ Browser API MCP calls      │
                    └─────────────┬──────────────┘
                                  │
                                  ▼
                    ┌────────────────────────────┐
                    │ Langflow Web Node          │
                    │ Backend API and UI         │
                    └─────────────┬──────────────┘
                                  │
                  ┌───────────────┼───────────────────────┐
                  │               │                       │
                  ▼               ▼                       ▼
      ┌─────────────────┐ ┌────────────────────┐ ┌────────────────────┐
      │ FastAPI routes  │ │ JobQueueService    │ │ In process runtime │
      │ auth persistence│ │ asyncio queues     │ │ lfx execution      │
      └────────┬────────┘ └─────────┬──────────┘ └─────────┬──────────┘
               │                    │                      │
               └────────────────────┴──────────────┬───────┘
                                                   ▼
                                   ┌──────────────────────────┐
                                   │ Models tools vector DBs  │
                                   │ external APIs            │
                                   └──────────────────────────┘

This mode is especially useful for:


Scaling architecture with Celery

Langflow also supports Celery as a distributed task backend.

Evidence in the repository includes:

This means Langflow can scale some background and asynchronous work by decoupling task execution from the web API layer.

                    ┌────────────────────────────┐
                    │        End Users           │
                    │ Browser API MCP calls      │
                    └─────────────┬──────────────┘
                                  │
                                  ▼
                    ┌────────────────────────────┐
                    │ Load Balancer optional     │
                    └─────────────┬──────────────┘
                                  │
                  ┌───────────────┼────────────────────────────┐
                  │               │                            │
                  ▼               ▼                            ▼
      ┌─────────────────┐ ┌─────────────────┐      ┌─────────────────┐
      │ Langflow Web 1  │ │ Langflow Web 2  │  ... │ Langflow Web N  │
      │ API UI auth     │ │ API UI auth     │      │ API UI auth     │
      └────────┬────────┘ └────────┬────────┘      └────────┬────────┘
               │                   │                        │
               └───────────────┬───┴───────────────┬────────┘
                               ▼                   ▼
                      ┌────────────────────────────────────┐
                      │ Celery broker and queue layer      │
                      │ Redis RabbitMQ or configured broker│
                      └────────────────┬───────────────────┘
                                       │
                    ┌──────────────────┼──────────────────┐
                    │                  │                  │
                    ▼                  ▼                  ▼
         ┌──────────────────┐ ┌──────────────────┐ ┌──────────────────┐
         │ Celery Worker 1  │ │ Celery Worker 2  │ │ Celery Worker N  │
         │ langflow tasks   │ │ langflow tasks   │ │ langflow tasks   │
         └────────┬─────────┘ └────────┬─────────┘ └────────┬─────────┘
                  │                    │                    │
                  └────────────────────┼────────────────────┘
                                       ▼
                       ┌────────────────────────────────┐
                       │ lfx execution and integrations │
                       │ models vector DBs tools APIs   │
                       └────────────────────────────────┘

This mode is better suited for:


Execution model

Langflow centers execution around flows as persisted graphs.

A typical execution path is:

  1. load a persisted flow definition
  2. map it to runtime graph structures
  3. resolve components
  4. evaluate graph edges and dependencies
  5. execute control flow and provider calls
  6. collect outputs
  7. surface the result to UI API or MCP clients

This allows the same flow artifact to be reused in multiple execution contexts.


Component model

Components are the central abstraction in Langflow.

Observed traits include:

This means a component is simultaneously:

Examples in the repository include:


Catalog and lazy loading

Langflow manages a broad component catalog through a dynamic loading strategy.

Main ideas:

  1. keep components grouped by category
  2. use dynamic import mappings
  3. discover component classes on demand
  4. cache discovered modules
  5. optionally rely on a generated component index for faster startup

Benefits:

Costs:


Persistence and compatibility

A flow is not treated as temporary UI state. It is treated as a persistent artifact.

That implies:

This is one of the most important architectural constraints in the repository.

Persistence strengthens this requirement further, because:


Extensibility

Langflow is designed to be extended through:

Custom components

The backend and runtime expose utilities and abstractions for creating custom components. The configurable components_path makes external component loading a first-class mechanism.

External integrations

The runtime ships adapters for:

Reusable flows

The presence of subflow and flow tool style components indicates flows can be composed into higher-order workflows.


Local development

Requirements from the repository docs include:

Recommended platforms:

Setup

make init

Run Langflow

uv run langflow run

Run frontend in development

make frontend

Build frontend

make build_frontend

Build and packaging

The repository uses both Python and frontend packaging workflows.

Python side

Frontend side

Coordination

The frontend build artifacts are copied into the backend package, so the final app is shipped as a unified distribution.


Docker and deployment

Relevant deployment-related paths include:

The development Dockerfile installs:

The development setup also installs the postgresql extra, which is a strong signal that PostgreSQL is a first-class persistence backend in supported environments.

This supports reproducible local and containerized development.


Scaling considerations

Langflow supports more than one execution mode for asynchronous and background work.

At the task execution layer, the repository shows a hybrid model:

This means Langflow can run in:

  1. Single-node mode
    • web server
    • in-process async jobs
    • local queue management
  2. Distributed mode
    • web or API nodes
    • broker-backed task dispatch
    • one or more Celery workers

Task backend selection

The task service selects its backend from configuration.

Important nuance

Celery is not the only execution path in Langflow.

The repository also contains:

So the most accurate statement is:

Langflow supports Celery for distributed task execution and scaling, but the platform also supports local non-Celery execution paths.

Practical scaling layers

Web and API scaling

Scale the FastAPI application horizontally behind a reverse proxy or load balancer.

Task execution scaling

Use Celery workers when background work needs to be distributed or isolated from web nodes.

Persistence scaling

Persistence is also part of scaling. In practical deployments, that means:

Dependency scaling

External systems usually become the dominant scaling factor:


Testing and quality

Repository signals include:

This suggests the project is maintained as a contributor-friendly product codebase rather than a minimal prototype.


Observability and operations

The repository highlights integrations such as:

Operationally, the stack also exposes:

For AI workflows, observability is especially valuable for:


Architectural tradeoffs

Strengths

Costs


How to add a new component

The repository guidance says to place new built-in components in the lfx layer, under the appropriate category in:

  1. Choose the correct component category
    • models
    • vector stores
    • tools
    • flow controls
    • data processing
    • input output
    • search
    • files and knowledge
    • or another existing category
  2. Create the component class Implement a new Python class that follows the repository’s component model:
    • display metadata
    • typed inputs
    • typed outputs
    • execution methods
  3. Update the category package init Add the component to the category __init__.py, preserving the module’s dynamic import conventions.

  4. Do not break compatibility Saved flows are long-lived artifacts. If your component is intended to be used in production flows:
    • avoid renaming the class casually
    • avoid changing output contracts recklessly
    • avoid removing fields used in existing flows
  5. Make UI metadata complete Components are not runtime-only objects. They are also consumed by the visual editor, so ensure:
    • display name
    • description
    • icon
    • field order
    • input metadata are coherent.
  6. Rebuild the component index if needed The repository includes:
    • scripts/build_component_index.py

    This index supports faster startup and deterministic component metadata packaging.

Component addition diagram

Decide component category
        │
        ▼
Create new component file in lfx components category
        │
        ▼
Add class metadata inputs outputs methods
        │
        ▼
Add to category dynamic imports
        │
        ▼
Validate runtime import and UI discovery
        │
        ▼
Run local app and test in canvas and playground
        │
        ▼
Rebuild component index if required

Practical advice


How to debug a flow end to end

A practical debugging path in Langflow usually crosses all major layers:

  1. frontend flow authoring
  2. backend API request
  3. runtime graph execution
  4. provider or tool integrations
  5. response rendering or streaming

Debugging workflow

Step 1: Validate the flow visually

Use the UI to confirm:

Step 2: Confirm persistence

Because flows are persisted artifacts, make sure the flow you are executing is actually the saved version you expect.

Step 3: Run via playground

The playground is often the shortest loop to see:

Step 4: Inspect backend logs

The backend contains:

So if the issue is not visible in the UI, check backend logs next.

Step 5: Trace runtime component loading

If the error is import related or provider related:

Step 6: Check provider dependencies

Many components wrap external systems:

A flow failure can be caused by:

Step 7: Check task mode

If Celery is enabled, the failure may occur in:

If Celery is disabled, the same issue may instead occur in:

Step 8: Check persistence and migrations

If the issue is about loading, saving, sessions, or startup:

End to end debugging diagram

UI flow issue reported
        │
        ▼
Check node graph and saved flow state
        │
        ▼
Run in playground
        │
        ├── Works -> issue may be API or deployment specific
        └── Fails
               │
               ▼
Inspect backend logs and request path
               │
               ▼
Inspect runtime component resolution
               │
               ├── import or dependency failure
               ├── invalid provider credentials
               ├── execution logic failure
               ├── queue or task failure
               ├── persistence or migration issue
               └── external system timeout
               │
               ▼
Use tracing telemetry and database inspection for deeper analysis

Good places to inspect


How Celery fits with TaskService and JobQueueService

Langflow uses a layered execution model for background tasks.

Core pieces

TaskService

TaskService is the abstraction layer that decides how tasks are launched.

It selects between:

based on runtime settings.

JobQueueService

JobQueueService manages local in-process queues and event managers for jobs.

This is particularly relevant when Celery is not enabled.

CeleryBackend

CeleryBackend wraps:

through Celery primitives like:

Relationship between them

Task requested
    │
    ▼
TaskService
    │
    ├── celery_enabled = true
    │        │
    │        ▼
    │   CeleryBackend
    │        │
    │        ├── send task to broker
    │        ├── worker executes task
    │        └── result tracked by Celery
    │
    └── celery_enabled = false
             │
             ▼
         AnyIOBackend plus JobQueueService
             │
             ├── create local queue
             ├── start asyncio task
             ├── stream or collect events
             └── manage local lifecycle

Why both exist

This dual design gives Langflow flexibility:

Practical interpretation

Celery integration diagram

Client request
    │
    ▼
Backend route or service
    │
    ▼
TaskService
    │
    ├── Local mode
    │      │
    │      ▼
    │   JobQueueService
    │      │
    │      ▼
    │   asyncio task execution in process
    │
    └── Celery mode
           │
           ▼
        CeleryBackend
           │
           ▼
        Broker queue
           │
           ▼
        Celery worker
           │
           ▼
        Task result and status

Persistence interaction

Celery-based execution does not replace persistence. It complements it.

Typical relationship:

Web/API layer
    │
    ├── reads and writes application state -> PostgreSQL
    ├── reads and writes files            -> storage service
    └── dispatches background work        -> Celery when enabled

So:

Operational implications

Local mode advantages

Celery mode advantages

Celery mode costs


Conclusion

Langflow is structured around a clear principle:

a visual flow should be designable, executable, deployable, and reusable without leaving the same component model

Its architecture is built on four core pillars:

It also supports:

In practice, Langflow is not just a visual AI editor. It is a composable execution platform for AI workflows, agents, tools, persistence-backed flow artifacts, and deployable runtime integrations.


Contributing

We welcome contributions from developers of all levels. If you’d like to contribute, please check our contributing guidelines and help make Langflow more accessible.

Security

For security information, see our Security Policy.

Deployment

Langflow is open source and can be deployed to major cloud providers. For deployment guidance, see the documentation under docs/ and deploy/.

References used for this architectural section