TechSetupGuides
Intermediateaillmworkflowlangchainpythonreactmcpagents

LangFlow: AI workflow orchestration platform

Build and deploy AI-powered agents and workflows with visual interface, MCP server support, and API deployment.

  1. Step 1

    What is LangFlow?

    LangFlow is a powerful visual platform for building and deploying AI-powered agents and workflows. It provides a drag-and-drop interface for creating LLM applications with support for all major language models, vector databases, and AI tools. Built with Python backend and React frontend, LangFlow turns visual workflows into deployable APIs and MCP servers.

  2. Step 2

    Technology stack

    LangFlow is built on a robust full-stack architecture:

    Backend:

    • Python 3.10-3.13
    • FastAPI (via langflow-base)
    • langchain and langchain-community integrations
    • SQLite/PostgreSQL for state management
    • Pydantic (lfx library) for validation

    Frontend:

    • React 18
    • Vite 7 as build tool
    • TypeScript 5
    • Tailwind CSS 3
    • Radix UI components
    • @xyflow/react for node-based visual workflow editor
    • Zustand for state management
    • TanStack Query for data fetching

    Key integrations:

    • MCP (Model Context Protocol) server support
    • All major LLM providers (OpenAI, Anthropic, Cohere, etc.)
    • Vector databases (Pinecone, Chroma, FAISS, etc.)
    • Observability (LangSmith, LangFuse)
    • Python code components for custom logic
    Backend:
    ├── Python 3.10-3.13
    ├── FastAPI (langflow-base>=0.9.3)
    ├── langchain-integrations
    ├── SQLite/PostgreSQL
    └── Pydantic (lfx library)
    
    Frontend:
    ├── React 18
    ├── Vite 7
    ├── TypeScript 5
    ├── Tailwind CSS 3
    ├── Radix UI
    ├── @xyflow/react (workflow canvas)
    ├── Zustand (state)
    └── TanStack Query
  3. Step 3

    Prerequisites

    Before installing LangFlow, ensure you have:

    • Python 3.10-3.13 installed
    • uv package manager (recommended) or pip
    • Node.js 20.19+ (only if building frontend from source)

    For Docker deployment, install Docker and Docker Compose.

    # Check Python version (3.10-3.13 required)
    python --version
    
    # Install uv package manager (recommended)
    curl -LsSf https://astral.sh/uv/install.sh | sh
    
    # Verify installation
    uv --version
  4. Step 4

    Quick start with uv

    The fastest way to get started with LangFlow is using uv, the modern Python package manager. This installs the complete LangFlow package with all dependencies.

    # From a fresh directory, install LangFlow
    uv pip install langflow -U
    
    # Start LangFlow
    uv run langflow run
    
    # Access at http://127.0.0.1:7860
  5. Step 5

    Development setup from source

    To contribute or run the latest development version, clone the repository and set up the development environment. This requires both Python and Node.js.

    # Clone the repository
    git clone https://github.com/langflow-ai/langflow.git
    cd langflow
    
    # Install dependencies and run backend
    make run_cli
    
    # For frontend development (in separate terminal)
    cd src/frontend
    npm install
    npm run dev
  6. Step 6

    Docker deployment

    Deploy LangFlow as a Docker container with default settings. Port 7860 is exposed for the web interface.

    # Basic container deployment
    docker run -p 7860:7860 langflowai/langflow:latest
    
    # With persistent storage
    docker run -p 7860:7860 \
      -v langflow_data:/app/langflow \
      -e LANGFLOW_HOST=0.0.0.0 \
      langflowai/langflow:latest
    
    # Access at http://localhost:7860
  7. Step 7

    Environment configuration

    Configure LangFlow using environment variables. Copy the example file and customize for your setup:

    • LANGFLOW_HOST: Host to bind to (default: 127.0.0.1)
    • LANGFLOW_PORT: Port to run on (default: 7860)
    • LANGFLOW_SECRET_KEY: Secret key for session management
    • AUTH_STRATEGY: Authentication strategy (none, login, jwt, etc.)
    • DB_URL: Database URL (default: sqlite)
    • STORAGE_PATH: Path for storing flow files
    # Copy example environment file
    cp .env.example .env
    
    # Edit with your configuration
    export LANGFLOW_HOST=0.0.0.0
    export LANGFLOW_PORT=7860
    export LANGFLOW_SECRET_KEY=your-secret-key-here
    export AUTH_STRATEGY=login
    export DB_URL=postgresql://user:pass@localhost:5432/langflow
    
    # Run with environment variables
    uv run langflow run
  8. Step 8

    Core features

    LangFlow provides powerful capabilities for building LLM applications:

    Visual builder: Drag and drop components to build workflows. Connect LLMs, tools, vector stores, and custom Python code visually.

    Playground: Test flows interactively with step-by-step debugging. See intermediate outputs and trace execution.

    Component ecosystem: Out-of-the-box support for:

    • All major LLMs (OpenAI, Anthropic, Claude, Mistral, Ollama, etc.)
    • Vector databases (Chroma, Pinecone, FAISS, Weaviate, etc.)
    • Retrieval systems and RAG pipelines
    • Tools and agents
    • Memory and conversation management

    Custom components: Write Python components to extend functionality. Source code access enables deep customization.

    API deployment: Export flows as APIs. Integrate into any application via REST endpoints.

    MCP server: Deploy flows as MCP (Model Context Protocol) servers. Turn workflows into tools for MCP-compatible clients.

    # Example: Custom Python component
    from pydantic import Field
    from langflow.custom import CustomComponent
    
    class CustomToolComponent(CustomComponent):
        display_name = "Custom Tool"
        description = "Custom tool for my workflow"
        
        def build(self, input_text: str = Field(..., description="Input text")) -> str:
            # Your custom logic here
            return f"Processed: {input_text}"
  9. Step 9

    Exporting and deployment

    Deploy flows as APIs or export as JSON for Python applications:

    API deployment: Built-in FastAPI server exposes endpoints for each flow. Configure authentication and rate limiting.

    JSON export: Export flow structure as JSON. Import into Python applications using the LangFlow SDK.

    MCP server: Deploy flows as Model Context Protocol servers. Integrate with MCP clients like Claude Desktop.

    # Export flow as JSON via playground
    # The JSON contains the full workflow definition
    
    # Use in Python application with SDK
    from langflow_sdk import flow
    
    # Load and execute flow
    result = flow.execute("path/to/flow.json", inputs={"input_text": "hello"})
  10. Step 10

    Optional dependencies

    Install additional feature sets as needed:

    • [docling]: Document parsing with OCR (PyTorch, Tesseract)
    • [audio]: Audio processing with WebRTC VAD
    • [local]: Local LLMs (llama-cpp-python, sentence-transformers)
    • [couchbase], [cassio]: Additional database integrations
    • [postgresql]: PostgreSQL support with psycopg2
    # Install with optional features
    uv pip install 'langflow[local]' -U  # For local LLMs
    uv pip install 'langflow[docling]' -U  # For document parsing
    uv pip install 'langflow[postgresql]' -U  # For PostgreSQL support
    
    # Or install all features
    uv pip install 'langflow[complete]' -U
  11. Step 11

    Resources

    Official documentation: https://docs.langflow.org

    GitHub repository: https://github.com/langflow-ai/langflow

    Community: Join Discord at https://discord.gg/EqksyE2EX9

    Desktop app: Download for Windows/macOS at https://www.langflow.org/desktop

    Documentation: https://docs.langflow.org
    GitHub: https://github.com/langflow-ai/langflow
    Discord: https://discord.gg/EqksyE2EX9
    Desktop: https://www.langflow.org/desktop

Feature requests

Sign in to suggest features or vote on existing ones.

No feature requests yet.

Discussion

0 people marked this as worked·Sign in to mark your own.

Sign in to join the discussion.

No comments yet.