Langflow
Send traces from self-hosted Langflow to Future AGI using Langflow's built-in Traceloop integration. No fork or custom component required.
Send Langflow flow and component spans to Future AGI using its built-in Traceloop integration. Configure the server once; you do not add tracing code to your flows.
Before you start
- A self-hosted Langflow server running
langflow==1.13.1withtraceloop-sdk==0.63.0and Python 3.12. - A Future AGI API key and secret key.
- A saved Langflow flow with a model provider configured, and a Langflow API key to run it.
This guide uses the released Python distribution, not a source fork. It covers text-only API runs with an OpenAI-compatible chat model. Langflow Desktop and managed Langflow Cloud deployments are not covered.
Install Langflow
In a new environment with uv:
uv venv --python 3.12
source .venv/bin/activate
uv pip install "langflow==1.13.1" "traceloop-sdk==0.63.0"
For an existing deployment, keep these versions in its dependency file and configure the environment of the process that runs Langflow.
Configure trace export
Set the following variables on the Langflow server. Keep model-provider credentials separate from your Future AGI keys.
export FI_API_KEY="your-futureagi-api-key"
export FI_SECRET_KEY="your-futureagi-secret-key"
# Langflow requires a nonempty value to enable its Traceloop tracer.
# This is a placeholder, not a Traceloop credential.
export TRACELOOP_API_KEY="langflow-otlp"
# The SDK appends /v1/traces to this base URL.
export TRACELOOP_BASE_URL="https://api.futureagi.com/tracer"
export TRACELOOP_HEADERS="$(python -c 'import os; from urllib.parse import quote; print("x-api-key={0},x-secret-key={1}".format(quote(os.environ["FI_API_KEY"], safe=""), quote(os.environ["FI_SECRET_KEY"], safe="")))')"
export OTEL_RESOURCE_ATTRIBUTES="project_name=my-langflow-app,project_type=observe"
export TRACELOOP_TRACE_CONTENT=true
export TRACELOOP_METRICS_ENABLED=false
export TRACELOOP_LOGGING_ENABLED=false
TRACELOOP_HEADERS authenticates exports to Future AGI. A Traceloop account is not required. The project_name resource attribute selects one Future AGI project for this server; it is independent of Langflow’s flow name.
For self-hosted Future AGI, replace TRACELOOP_BASE_URL with your collector’s base URL including /tracer, but without /v1/traces.
Warning
This route exports flow and component inputs and outputs. TRACELOOP_TRACE_CONTENT=false controls the SDK’s model instrumentation, but does not remove content from Langflow’s own component spans. Do not use it as a server-wide redaction switch. Error events can also contain exception text and stack traces. Use synthetic or approved data, or apply your organization’s filtering policy at an OpenTelemetry Collector before forwarding traces.
Use this tracer alone for these flows. Adding traceAI or OpenInference instrumentation to the same model calls can create duplicate spans. Langflow’s general OTEL_EXPORTER_OTLP_ENDPOINT configuration is a different, service-health export: it deliberately excludes prompts, completions and component payloads.
Start the server and run a flow
Restart Langflow after changing its environment:
langflow run --host 127.0.0.1 --port 7860
Keep your existing authentication and deployment configuration. The loopback address above is for a server on your own machine, not a public deployment.
For a small example, use Langflow’s Basic Prompting starter flow with an OpenAI Compatible language model. Set its base URL to https://openrouter.ai/api/v1, use your own OpenRouter key, and select openai/gpt-4.1-nano. Set the maximum output to 32 tokens and turn streaming off. Ask “What is 17 times 23? Reply with the number only.”
If the OpenRouter key comes from the server environment, authorize that specific destination with LANGFLOW_PROVIDER_CREDENTIAL_ALLOWED_HOSTS=https://openrouter.ai before starting Langflow. This approval is for your OpenRouter credential, not permission to send another provider’s key there.
Run the saved flow through Langflow’s API using its API access instructions and your Langflow API key. The expected answer is 391. Your Future AGI keys belong only in the server’s trace-export configuration, not in the model’s API-key field.
Open the traces in Future AGI
Open Observe, select my-langflow-app, and inspect the recent Langflow spans.
- Flow and component spans: Langflow names the run after the flow and emits component spans such as
Chat Input,Prompt Template,Language Model, andChat Output. Componentinputsandoutputsare retained as span attributes. - Model calls:
ChatOpenAI.chatcarries the prompt, response, model, and token counts when the provider returns them. Model calls appear as separate traces, not children of the Langflow component trace. This setup does not join them into one end-to-end trace. Component spans can appear asunknownrather than LLM or tool observations; their attributes remain available. - Errors: inspect exception events as well as model-span status. Langflow’s component tracer does not guarantee that every component failure sets the root span’s status to
ERROR.
The FI_HIDE_INPUTS, FI_HIDE_OUTPUTS, and FI_REDACT settings do not control this native integration. Langflow session labels are not automatically mapped to Future AGI sessions.
Troubleshooting
| Symptom | Action |
|---|---|
| No trace export | Set the nonempty TRACELOOP_API_KEY placeholder as well as the base URL and headers, then restart Langflow. |
| HTTP 401 | Check the Future AGI key pair in TRACELOOP_HEADERS. Keep the percent-encoding step; commas and other reserved characters can otherwise break header parsing. |
| HTTP 400 | Check that OTEL_RESOURCE_ATTRIBUTES contains project_name and project_type=observe. |
| Requests go to the wrong path | Use https://api.futureagi.com/tracer, not a URL already ending in /v1/traces. |
| Metrics or logs fail to export | Keep TRACELOOP_METRICS_ENABLED=false and TRACELOOP_LOGGING_ENABLED=false; this integration sends traces only. |
| Content still appears with the SDK content switch off | Langflow emits its own component payloads independently. Apply filtering before export if those payloads must not leave your environment. |
| Base64 image uploads fail | Use text-only prompts for this route. Traceloop’s image-upload endpoint is not a Future AGI trace-ingestion endpoint. |
Next steps
Questions & Discussion