@copperiq/n8n-nodes-llm-openai-langfuse
v1.0.3
Published
n8n OpenAI Language Model with built-in Langfuse observability and tracing
Readme
n8n-nodes-ai-langfuse
This is an n8n community node that provides an OpenAI Language Model with built-in Langfuse observability and tracing.
n8n is a fair-code licensed workflow automation platform.
Langfuse is an open-source LLM engineering platform for tracing, evaluating, and monitoring AI applications.
Features
- OpenAI Language Model: Full-featured OpenAI chat model with support for all latest models
- Built-in Langfuse Tracing: Automatic observability for all LLM interactions
- Organized Traces: Traces named as
WorkflowName - NodeNamewith model-specific observation names - Session Tracking: Group related traces using session IDs
- Custom Metadata: Add custom metadata and tags for filtering and organization
- Token Tracking: Accurate token usage tracking including tool calls
- User Tracking: Associate traces with specific users
Installation
Follow the installation guide in the n8n community nodes documentation.
Using npm
npm install @copperiq/n8n-nodes-ai-langfuseUsing n8n's UI
- Go to Settings > Community Nodes
- Select Install
- Enter
@copperiq/n8n-nodes-ai-langfusein the Enter npm package name field - Agree to the risks of using community nodes
- Select Install
After installing the node, you can use it like any other node in your n8n workflows.
Configuration
Prerequisites
- An OpenAI API key
- A Langfuse account (cloud or self-hosted)
- Langfuse public and secret keys from your project settings
Credentials Setup
- Create new credentials: OpenAI API with Langfuse
- Enter your OpenAI API Key
- Enter your Langfuse Public Key
- Enter your Langfuse Secret Key
- (Optional) Enter your Langfuse Base URL if using self-hosted Langfuse
Usage
Basic Setup
- Add the OpenAI Language Model (Langfuse) node to your workflow
- Select or create OpenAI API with Langfuse credentials
- Choose your desired model (e.g.,
gpt-4o,gpt-4-turbo,gpt-3.5-turbo) - Configure any additional options (temperature, max tokens, etc.)
Langfuse Tracking
The node includes optional Langfuse tracking fields for enhanced observability:
- Session ID: Group related traces together (e.g., multi-turn conversations)
- User ID: Associate traces with specific users
- Tags: Add comma-separated tags for filtering (e.g.,
production,customer-support) - Custom Metadata: Add any additional context as JSON
All fields support n8n expressions for dynamic values:
// Example session ID from incoming data
{{ $json.sessionId }}
// Example user ID
{{ $json.userId }}
// Example tags
production, api-call, {{ $json.department }}
// Example metadata
{
"customerTier": "{{ $json.tier }}",
"region": "{{ $json.region }}"
}Trace Organization
Traces in Langfuse are automatically organized with:
- Trace Name:
WorkflowName - NodeName(e.g.,Customer Support - AI Assistant) - Observation Names: Actual model name (e.g.,
gpt-4o) - Trace ID: Unique per workflow execution and node
- Metadata: Includes execution ID and workflow name
Examples
Simple Chat Completion
1. Trigger (e.g., Webhook)
2. OpenAI Language Model (Langfuse)
- Model: gpt-4o
- System Message: "You are a helpful assistant"
- User Message: {{ $json.userMessage }}
3. Respond to WebhookConversation with Session Tracking
1. Webhook Trigger
2. OpenAI Language Model (Langfuse)
- Model: gpt-4o
- Langfuse Tracking:
* Session ID: {{ $json.conversationId }}
* User ID: {{ $json.userId }}
* Tags: support, {{ $json.priority }}
3. Store in Database
4. Respond to WebhookCompatibility
- Requires n8n version 1.0.0 or above
- Requires Node.js 18.0.0 or above
- Compatible with all OpenAI models including latest GPT-4 and GPT-3.5 models
Resources
Support
For issues, questions, or feature requests, please visit:
- GitHub Issues: Copper-IQ/n8n-nodes-ai-langfuse
- Email: [email protected]
License
Version History
1.0.0
- Initial release
- OpenAI Language Model with Langfuse integration
- Session tracking and custom metadata support
- Automatic token usage tracking
- Professional trace naming and organization
