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:
- Openlayer account - Sign up at openlayer.com
- Openlayer project - Create a project in your Openlayer dashboard
- Openlayer API key - Get your API key from Settings → API Keys
- Inference pipeline(s) - Create one or more inference pipelines in your Openlayer project for LLM monitoring
- 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
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
- Navigate to your Openlayer project → Inference Pipeline
- See your traces appear in real-time with detailed execution information
Configuration
Environment variables
The integration uses environment variables for configuration:
| Variable | Required | Description |
|---|
OPENLAYER_API_KEY | Yes | Your Openlayer API key |
OPENLAYER_INFERENCE_PIPELINE_ID | Yes* | Default pipeline ID for all flows |
OPENLAYER_PIPELINE_<FLOW_NAME> | No | Pipeline ID for a specific flow |
OPENLAYER_LANGFLOW_MAPPING | No | JSON 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:
- Convert to uppercase
- Replace spaces and special characters with underscores
- Add
OPENLAYER_PIPELINE_ prefix
Examples:
| Flow Name in Langflow | Environment Variable |
|---|
Customer Support | OPENLAYER_PIPELINE_CUSTOMER_SUPPORT |
My-Production-Bot | OPENLAYER_PIPELINE_MY_PRODUCTION_BOT |
Sales v2.0 | OPENLAYER_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:
OPENLAYER_PIPELINE_<FLOW_NAME> (highest priority)
OPENLAYER_LANGFLOW_MAPPING
OPENLAYER_INFERENCE_PIPELINE_ID (fallback)