Integrate Langfuse with Langflow
Langfuse is an observability and analytics platform specifically designed for language models and AI applications.
+Langfuse (GitHub) is an open-source platform for LLM observability. It provides tracing and monitoring capabilities for AI applications, helping developers debug, analyze, and optimize their AI systems. Langfuse integrates with various tools and frameworks such as workflows builders like Langflow.
This guide walks you through how to configure Langflow to collect tracing data about your flow executions and automatically send the data to Langfuse.
+Prerequisites​
- A project in Langflow with a runnable flow -
- A Langfuse Cloud account in any data region -
- A Langfuse organization and project +
- A Langfuse Cloud or self-hosted Langfuse account
Create Langfuse project credentials​
+Set Langfuse credentials as environment variables​
-
-
In Langfuse, go to your project settings, and then create a new set of API keys.
+In Langfuse, go to Project Settings, and then create a new set of API keys.
-
Copy the following API key information:
+
+
- Secret Key
- Public Key
- Host URL
-
+
- Set your Langfuse project credentials as environment variables in the same environment where you run Langflow.
Set your Langfuse credentials as environment variables​
-Set your Langfuse project credentials as environment variables in the same environment where you run Langflow.
-You can use any method you prefer to set environment variables. -The following examples show how to set environment variables in a terminal session (Linux or macOS) and in a command prompt session (Windows):
+The following examples set environment variables in a Linux or macOS terminal session or in a Windows command prompt session:
+Replace SECRET_KEY, PUBLIC_KEY, and HOST_URL with the API key information you copied from Langfuse.
- Linux or macOS
- Windows
_10export LANGFUSE_SECRET_KEY=SECRET_KEY_10export LANGFUSE_PUBLIC_KEY=PUBLIC_KEY_10export LANGFUSE_HOST=HOST_URL
_10set LANGFUSE_SECRET_KEY=SECRET_KEY_10set LANGFUSE_PUBLIC_KEY=PUBLIC_KEY_10set LANGFUSE_HOST=HOST_URL
Replace SECRET_KEY, PUBLIC_KEY, and HOST_URL with the API key information you copied from Langfuse.
Start Langflow and run a flow​
+Start Langflow and view traces in Langfuse​
- Start Langflow in the same terminal or environment where you set the environment variables:
_10uv run langflow run
-
-
- In Langflow, open an existing project, and then run a flow. +
-
+
In Langflow, open an existing project, and then run a flow.
+Langflow automatically collects and sends tracing data about the flow execution to Langfuse.
+
+ -
+
View the collected data in your Langfuse project dashboard.
+
View tracing data in Langfuse​
-Langflow automatically collects and sends tracing data about the flow execution to Langfuse. -You can view the collected data in your Langfuse project dashboard.
-Disable the Langfuse integration​
-To disable the Langfuse integration, remove the environment variables you set in the previous steps and restart Langflow.

