Langflow (tracing)
Langflow (tracing)
Langflow is a visual framework by DataStax for building multi-agent and RAG applications. It provides a drag-and-drop interface for composing LLM pipelines with components for models, prompts, tools, and data sources. Langflow is built on LangChain, so Respan tracing uses respan-instrumentation-langchain to capture component runs, underlying LangChain calls, tools, retrievers, and LLM generations — and gateway routing through the OpenAI-compatible Respan endpoint.
Set up Respan
Create an account at platform.respan.ai and grab an API key.
Run npx @respan/cli setup to set up with your coding agent.
Use Respan Gateway
See Langflow gateway setup to route this integration through the Respan gateway.
Example projects
Setup
Set environment variables
RESPAN_API_KEY is used to export traces to Respan. Set OPENAI_API_KEY too when your Langflow components call provider-backed models.
Initialize and run
For custom Langflow component code, attach the Respan LangChain callback to each LangChain runnable invocation. Reuse one callback handler so independent component runs are grouped into one trace.
View your trace
Open the Traces page to see your Langflow workflow with component-level operations, LLM calls, retriever spans, and tool calls.
Configuration
Attributes
In Respan()
Set defaults at initialization — these apply to all spans.
With propagate_attributes
Override per-request using a context scope.
Decorators (optional)
Decorators are not required. Langflow runs are traced through LangChain callbacks. Use @workflow and @task (Python) or withWorkflow and withTask (TypeScript) when you want to group one or more flow executions inside a named application workflow.
Examples
Custom component callback grouping
Use one callback handler for the component invocation so multiple LangChain calls in the same custom component share a trace.
Exported flows
Exported flows can be run normally after Respan telemetry is initialized. For custom components inside the flow, pass add_respan_callback(...) when invoking LangChain runnables.