Skip to main content
Langflow integration with Openlayer Langflow is a visual framework for building multi-agent and RAG applications. Openlayer’s native integration with Langflow enables automatic tracing and monitoring of your Langflow workflows, providing real-time observability, performance tracking, and quality evaluation. The integration captures comprehensive trace data including LLM calls, tool executions, agent reasoning steps, retrieval operations, and full execution hierarchies.

Benefits

The Openlayer integration for Langflow provides:
  • Automatic tracing - No code changes required; traces are captured automatically when you run your flows
  • Real-time monitoring - Track performance, latency, and costs across different flows
  • Quality evaluation - Run tests on production traces to ensure your flows meet quality standards
  • Debugging - Detailed trace hierarchies help identify issues in complex multi-step workflows
  • Multi-flow support - Configure different inference pipelines for different flows or environments

Prerequisites

Before you begin, you need:
  1. Openlayer account - Sign up at openlayer.com
  2. Openlayer project - Create a project in your Openlayer dashboard
  3. Openlayer API key - Get your API key from Settings → API Keys
  4. Inference pipeline(s) - Create one or more inference pipelines in your Openlayer project for LLM monitoring
  5. Openlayer Python SDK - Install with pip install openlayer

Quick start

Step 1: Set environment variables

At minimum, you need to set your Openlayer API key and a default inference pipeline ID:
export OPENLAYER_API_KEY="your_api_key_here"
export OPENLAYER_INFERENCE_PIPELINE_ID="your_pipeline_id_here"

Step 2: Run Langflow

langflow run

Step 3: Execute your flow

When you run any flow in Langflow, traces will automatically be sent to Openlayer.

Step 4: View traces in Openlayer

  1. Navigate to your Openlayer project → Inference Pipeline
  2. See your traces appear in real-time with detailed execution information

Configuration

Environment variables

The integration uses environment variables for configuration:
VariableRequiredDescription
OPENLAYER_API_KEYYesYour Openlayer API key
OPENLAYER_INFERENCE_PIPELINE_IDYes*Default pipeline ID for all flows
OPENLAYER_PIPELINE_<FLOW_NAME>NoPipeline ID for a specific flow
OPENLAYER_LANGFLOW_MAPPINGNoJSON mapping of flows to pipeline IDs
*Required unless using flow-specific configuration

Single flow configuration

If you have one flow or want all flows to use the same pipeline:
export OPENLAYER_API_KEY="your_api_key"
export OPENLAYER_INFERENCE_PIPELINE_ID="pipeline_default_123"

Multiple flows with flow-specific variables

For multiple flows with explicit control over each one:
export OPENLAYER_API_KEY="your_api_key"

# For a flow named "Customer Support"
export OPENLAYER_PIPELINE_CUSTOMER_SUPPORT="pipeline_support_456"

# For a flow named "Sales Assistant"
export OPENLAYER_PIPELINE_SALES_ASSISTANT="pipeline_sales_789"

# Fallback for any other flows
export OPENLAYER_INFERENCE_PIPELINE_ID="pipeline_default_123"

Flow name mapping

Flow names in Langflow are automatically converted to environment variable names:
  1. Convert to uppercase
  2. Replace spaces and special characters with underscores
  3. Add OPENLAYER_PIPELINE_ prefix
Examples:
Flow Name in LangflowEnvironment Variable
Customer SupportOPENLAYER_PIPELINE_CUSTOMER_SUPPORT
My-Production-BotOPENLAYER_PIPELINE_MY_PRODUCTION_BOT
Sales v2.0OPENLAYER_PIPELINE_SALES_V2_0

Multiple flows with JSON mapping

For centralized configuration of many flows:
export OPENLAYER_API_KEY="your_api_key"

export OPENLAYER_LANGFLOW_MAPPING='{
  "Customer Support": "pipeline_support_456",
  "Sales Assistant": "pipeline_sales_789",
  "Data Analysis": "pipeline_analytics_012"
}'

# Fallback for unmapped flows
export OPENLAYER_INFERENCE_PIPELINE_ID="pipeline_default_123"
Flow names in the JSON mapping must match exactly (case-sensitive, including spaces) with your flow names in Langflow.

Configuration priority

When a flow runs, the system checks for pipeline IDs in this order:
  1. OPENLAYER_PIPELINE_<FLOW_NAME> (highest priority)
  2. OPENLAYER_LANGFLOW_MAPPING
  3. OPENLAYER_INFERENCE_PIPELINE_ID (fallback)