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.
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.
Requires Python 3.10 to 3.13 and uv as the recommended package manager.
From a fresh directory, run:
uv pip install langflow -U
uv run langflow run
Langflow starts at http://127.0.0.1:7860.
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.
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.
This section provides a technical overview of Langflow’s architecture, repository structure, runtime model, development workflow, deployment, persistence, and scaling considerations.
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.
Langflow is organized as a layered system:
The repository guidance also describes the stack this way:
lfx = executor corelangflow-base = platform layerlangflow = integrated distributionsrc/frontend = UIHigh-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:
README.md — public product overviewAGENTS.md — repository architecture guidanceDEVELOPMENT.md — local development setupDESIGN.md — design notesCONTRIBUTING.md — contributor workflowRELEASE.md — release processLocation:
src/frontend/Technology:
Frontend responsibilities include:
Frontend entrypoint:
src/frontend/src/index.tsxThe frontend is developed separately, but in the final product build it is copied into the backend package and served from there.
Location:
src/backend/base/langflow/This layer contains:
Responsibilities include:
Observed startup options include:
hostportworkersworker_timeoutcomponents_pathenv_filelog_levelThis shows the backend is designed to run as a configurable server process.
Location:
src/lfx/src/lfx/This is the execution engine and component framework.
It contains:
Responsibilities include:
The lfx.components package includes many categories of integrations, including:
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.
┌──────────────────────┐
│ 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 │
└──────────────────┘ └──────────────────────┘ └──────────────────────┘
┌───────────────────────────────┐
│ 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 │
└──────────────────────┘ └──────────────────────┘ └──────────────────────┘
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
┌──────────────┐
│ 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 │
└──────────────────────┘
┌──────────────┐
│ 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│
└────────────────────────────┘
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
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 │
└─────────────────────────────┘
┌──────────────────────┐
│ 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│
└──────────────────────┘
┌────────────────────────────┐
│ 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 in Langflow lives primarily in the backend platform layer.
The platform explicitly registers and uses services such as:
database_servicestorage_servicevariable_servicestate_servicesession_servicestore_servicetransaction_serviceThis means persistence is not treated as a single monolithic concern. Instead, the repository models different kinds of persisted state separately.
This is where Langflow stores structured application state such as:
PostgreSQL is explicitly supported in the repository, including:
The presence of a storage_service strongly suggests a separate layer for:
Additional services indicate the system also models:
The repository shows direct evidence of PostgreSQL support:
postgresql extraSo the most accurate statement is:
Langflow uses the backend platform layer for persistence, and PostgreSQL is an explicitly supported relational persistence backend.
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
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
Langflow supports a local execution model without Celery.
In this mode, the platform uses:
JobQueueServiceAnyIOBackendasyncio orchestration for some flows and streams ┌────────────────────────────┐
│ 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:
Langflow also supports Celery as a distributed task backend.
Evidence in the repository includes:
CeleryBackendlangflow.worker.tasks.*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:
Langflow centers execution around flows as persisted graphs.
A typical execution path is:
This allows the same flow artifact to be reused in multiple execution contexts.
Components are the central abstraction in Langflow.
Observed traits include:
This means a component is simultaneously:
Examples in the repository include:
Langflow manages a broad component catalog through a dynamic loading strategy.
Main ideas:
Benefits:
Costs:
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:
Langflow is designed to be extended through:
The backend and runtime expose utilities and abstractions for creating custom components. The configurable components_path makes external component loading a first-class mechanism.
The runtime ships adapters for:
The presence of subflow and flow tool style components indicates flows can be composed into higher-order workflows.
Requirements from the repository docs include:
gitmakeuvv22.12v10.9Recommended platforms:
make init
uv run langflow run
make frontend
make build_frontend
The repository uses both Python and frontend packaging workflows.
pyproject.tomluv.lockpackage.jsonpackage-lock.jsonMakefileMakefile.frontendThe frontend build artifacts are copied into the backend package, so the final app is shipped as a unified distribution.
Relevant deployment-related paths include:
docker/docker_example/deploy/render.yamlThe development Dockerfile installs:
uvThe 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.
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:
The task service selects its backend from configuration.
CeleryBackendAnyIOBackendCelery is not the only execution path in Langflow.
The repository also contains:
JobQueueServiceasyncio.Queue based execution and event handlingSo the most accurate statement is:
Langflow supports Celery for distributed task execution and scaling, but the platform also supports local non-Celery execution paths.
Scale the FastAPI application horizontally behind a reverse proxy or load balancer.
Use Celery workers when background work needs to be distributed or isolated from web nodes.
Persistence is also part of scaling. In practical deployments, that means:
External systems usually become the dominant scaling factor:
Repository signals include:
This suggests the project is maintained as a contributor-friendly product codebase rather than a minimal prototype.
The repository highlights integrations such as:
Operationally, the stack also exposes:
For AI workflows, observability is especially valuable for:
The repository guidance says to place new built-in components in the lfx layer, under the appropriate category in:
src/lfx/src/lfx/components/<category>/Update the category package init
Add the component to the category __init__.py, preserving the module’s dynamic import conventions.
scripts/build_component_index.pyThis index supports faster startup and deterministic component metadata packaging.
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
lfxA practical debugging path in Langflow usually crosses all major layers:
Use the UI to confirm:
Because flows are persisted artifacts, make sure the flow you are executing is actually the saved version you expect.
The playground is often the shortest loop to see:
The backend contains:
So if the issue is not visible in the UI, check backend logs next.
If the error is import related or provider related:
lfx.componentsMany components wrap external systems:
A flow failure can be caused by:
If Celery is enabled, the failure may occur in:
If Celery is disabled, the same issue may instead occur in:
If the issue is about loading, saving, sessions, or startup:
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
src/backend/base/langflow/main.pysrc/backend/base/langflow/api/src/backend/base/langflow/services/src/backend/base/langflow/services/database/src/backend/base/langflow/services/storage/src/lfx/src/lfx/components/src/lfx/src/lfx/cli/serve_app.pyLangflow uses a layered execution model for background tasks.
TaskService is the abstraction layer that decides how tasks are launched.
It selects between:
CeleryBackendAnyIOBackendbased on runtime settings.
JobQueueService manages local in-process queues and event managers for jobs.
This is particularly relevant when Celery is not enabled.
CeleryBackend wraps:
through Celery primitives like:
.delay()AsyncResultTask 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
This dual design gives Langflow flexibility:
TaskService is the policy and dispatch layerJobQueueService is the local queue execution and tracking layerCeleryBackend is the distributed task execution layerClient 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
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:
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:
lfx runtime for graph executionIt 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.
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.
For security information, see our Security Policy.
Langflow is open source and can be deployed to major cloud providers. For deployment guidance, see the documentation under docs/ and deploy/.
AGENTS.mddocs/agents/ARCHITECTURE.mdDEVELOPMENT.mdCONTRIBUTING.mdMakefileMakefile.frontendsrc/frontend/src/index.tsxsrc/backend/base/langflow/__main__.pysrc/backend/base/langflow/main.pysrc/backend/base/langflow/core/celery_app.pysrc/backend/base/langflow/api/build.pysrc/backend/base/langflow/services/utils.pysrc/backend/base/langflow/services/task/service.pysrc/backend/base/langflow/services/task/backends/celery.pysrc/backend/base/langflow/services/job_queue/service.pysrc/backend/base/langflow/services/tracing/service.pysrc/backend/base/langflow/custom/__init__.pysrc/lfx/src/lfx/components/__init__.pysrc/lfx/src/lfx/cli/run.pysrc/lfx/src/lfx/cli/serve_app.pysrc/lfx/src/lfx/services/schema.pysrc/lfx/PLUGGABLE_SERVICES.mdscripts/build_component_index.pydocker/dev.Dockerfile