CodeVetter
← All unpacks
CodeVetter · Repo Unpack evidence

langflow-ai/langflow

Scanned commit 5621dcfd84 dated 2026-09-15 — last upstream commit. Generated by codevetter 1.12.0 on 2026-09-22.

github.com/langflow-ai/langflow ↗ · 3997 files · 32.9 MB · scan capped

Langflow is a powerful platform for building and deploying AI-powered agents and workflows.

Deep analysis by swe-2 via the devin CLI on 2026-09-22 (runtime not recorded) — every claim below links to its cited source files.

Overview

Langflow is a visual builder and runtime for AI/LLM workflows (agents, RAG pipelines, tool chains): users compose 'components' into a flow graph on a React canvas, persist the graph as JSON in a database, and execute it through a FastAPI backend that compiles the payload into a vertex graph and runs it against a pluggable component catalog. The repo is a uv monorepo split into lfx (headless executor, shared primitives, built-in components, its own `lfx`/`lfx-mcp` CLIs), langflow-base (the FastAPI app, service layer, auth, SQLModel/Alembic persistence), the curated `langflow` distribution that adds lfx-* provider bundles, a React 19 + Vite frontend, and a `langflow-sdk` Python client. Its distinctive shape is a heavily-pluginized service layer: auth, authorization, catalog/model-provider policy and even routes are replaceable through entry points and lfx.toml config.

System map

Langflow ships as a uv workspace whose public dependency direction is langflow -> langflow-base -> lfx, plus ~24 lfx-* provider bundle packages and a React/Vite frontend. The primary entrypoint is the `langflow` console script (langflow_launcher -> Typer app in __main__.py -> `langflow run`), which boots a FastAPI app created by create_app() in main.py and served by gunicorn on Linux or direct uvicorn on Windows/macOS. All cross-cutting capabilities (auth, DB, cache, storage, telemetry, tracing, job queue, ...) live behind a singleton ServiceManager in lfx with factory registration plus entry-point/config-file plugin discovery. Persistence is SQLAlchemy 2 async + SQLModel (aiosqlite default, Postgres supported) migrated by Alembic. The graph execution engine (Graph, Vertex, Edge) lives in lfx and is shared by the server and the standalone `lfx run`/`lfx serve` CLIs.

All 13 system map claims →

Feature catalog

The v1 API (~35 routers under /api/v1) covers flow CRUD and sharing, graph build/run (job-queue + SSE), webhooks, files, variables, users/API keys, folders/projects, knowledge bases, memories, monitor/traces, a Langflow Store client, voice mode, A2A, an OpenAI-compatible responses route, MCP servers (global and per-project), and a full authz administration surface (shares, roles, assignments, teams, audit, me). v2 under /api/v2 hosts the workflow execution contract (sync/stream/background runs via a shared lfx router bound to a Langflow host), v2 files/MCP, and registration. Beyond HTTP there is the `lfx` executor CLI (run/serve a flow without the DB), `lfx-mcp`, a Python SDK, and a feature-gated 'agentic experience' with its own routers.

All 14 feature catalog claims →

Data flow

The core data path is: flow JSON (nodes+edges) persisted in the `flow` SQLModel table -> loaded owner-scoped or share-aware -> optionally sanitized by caller-aware component policy -> tweaks applied -> Graph.from_payload compiles vertices/edges -> graph.arun executes vertices and emits events -> RunResponse/SSE to the caller while messages, transactions, and vertex_builds rows persist execution history. Secrets (global variables, API keys) are Fernet-encrypted at rest using LANGFLOW_SECRET_KEY. Files go through a local/S3 StorageService namespaced per flow. Components themselves are discovered at boot from built-ins, components_path dirs, extension bundles, and remote bundle URLs, and cached in component_cache.

Behavior traces

Traced end-to-end: (1) `langflow run` startup from console script through lifespan service init; (2) a synchronous POST /api/v1/run/{flow} execution; (3) the editor's build+events flow; (4) flow deletion cascade; (5) v2 workflow dispatch; (6) shutdown ordering. Each hop below names the actual functions in call order.

Testing signals

Backend tests are pytest with asyncio_mode=auto across three roots (src/backend/tests ~778 files, src/lfx/tests ~425, src/bundles/*/tests ~76), with a rich marker taxonomy and heavyweight plugins (blockbuster for blocking-call detection, pytest-timeout in thread/faulthandler mode, xdist, rerunfailures, flakefinder, hypothesis, pyleak). The conftest boots the real app via create_app/LifespanManager over ASGITransport and StaticPool SQLite. Frontend uses Jest unit tests plus Playwright e2e (a11y/core/extended/live suites) with merged nyc coverage. CI runs a Python matrix (3.10/3.14) with split groups, bundle-guarded jobs, template tests, docker tests, CodeQL, and DB-migration validation.

Risk map

The dominant risk theme is executing caller-influenced code: custom components are arbitrary Python exec'd at build/validation time, stored flow JSON embeds component source, and multiple policy layers (custom_component_admin_only, tweak policy, owner-only tweaks, catalog/model-provider policy) exist to contain that. Auth surface risk is managed but default-lenient (AUTO_LOGIN, permissive CORS with warnings, SSRF protection off by default, short SECRET_KEY tolerated with legacy decryption). Supply-chain and infra footguns include remote bundle zips at startup, entry-point service replacement, per-worker in-memory job queues, and pickle in the cache service.

All 14 risk map claims →

Extension points

Langflow is built to be extended at five seams: (1) component/extension bundles via the `langflow.extensions` entry point + extension.json manifests + seed dirs + components_path; (2) service replacement via `lfx.services` entry points and lfx.toml/pyproject config (auth SSO, authorization/RBAC, catalog policy, model-provider policy, policy bundle); (3) HTTP route plugins via the `langflow.plugins` entry point with conflict-protected registration; (4) CLI plugins via register_cli_command_plugins; (5) enterprise hooks via the lifespan hook registry. Custom components subclass lfx Component and are discovered from directories.

Contributor handoff

Onboarding essentials: this is a uv workspace — always `uv run` Python commands, sync sub-package dev groups before testing inside them, run `make format_backend` before committing (ruff select=ALL, line-length 120, big per-file-ignore table), and respect the one-way dependency direction (lfx never imports langflow.*). Component class names are stable identifiers — never rename. Flow JSON shape is a contract. DB model changes require alembic revisions. The service layer is registry-driven: add services via factories + ServiceType, not globals. Highest-risk edit zones: main.py lifespan ordering, endpoints.py/build.py/chat.py auth+policy ordering, and anything that executes stored component code.

Languages

LanguageFilesShare of source
Python407753%
TypeScript252333%
Markdown1514docs/config
JavaScript6568%
Shell4496%
JSON389docs/config
YAML83docs/config
TOML290%

Start reading here

Probable source entrypoint: src/ — inferred from the directory tree and manifest, not the upstream docs.

Source roots

src/ (1858 files)

Repository structure

Top-level pathFiles
docs/1862
src/1858
scripts/103
.github/63
.agents/37
docker/17
deploy/13
regressions/5

Docs found: CLAUDE.mdCONTRIBUTING.mdREADME.mddocs/DEPRECATED_MACOS_SUPPORT_INVESTIGATION.mddocs/README.mddocs/TORCH_MACOS_AMD64_PYTHON313_INVESTIGATION.mddocs/agents/ANTI-PATTERNS.mddocs/agents/ARCHITECTURE.mddocs/agents/COMPONENTS.mddocs/agents/CONTRACTS.md

Package

package.json — , 1 declared dependencies.

@types/node

CI & config entrypoints

Structural health signals

Average score 7.5/10 across 96 analyzed source files; 14 hotspots surfaced.

These are deterministic review leads — size, churn, and structural signals — not proof of a bug in this project.

Recent history