# n8n Node for Langfuse Prompt Management

The Langfuse n8n node enables seamless integration of [Langfuse's Prompt Management](/content/docs/prompts/get-started/index.html) with n8n workflows. This community-maintained node allows you to fetch and use prompts directly from your Langfuse project within n8n workflows.

> **What is n8n?** [n8n](https://github.com/n8n-io/n8n) is an open‑source, node‑based workflow automation platform that lets you visually connect and orchestrate APIs, apps, and data without writing full code.

**Langfuse Node in example n8n workflow:**

## Installation

### Self-hosted n8n

Install via **Settings** > **Community Nodes** using package name: [`@langfuse/n8n-nodes-langfuse`](https://www.npmjs.com/package/@langfuse/n8n-nodes-langfuse)

### n8n Cloud

Use the node directly in your workflows by searching for `Langfuse`.

## Operations

### Get Prompt

This node can be used to get a prompt from [Langfuse Prompt Management](/content/docs/prompts/index.html).

Steps

1. Enter the `name` of the prompt
2. Enter the `label` that identifies the prompt version that you want to fetch. Defaults to "production". Learn more about prompt labels in Langfuse [here](/content/docs/prompts/get-started#labels/index.html).

_Example workflow that retrieves the system prompt for the agent from Langfuse:_

## Credentials

To use this node, you need to authenticate with Langfuse. You'll need:

1. A Langfuse account, either [Langfuse Cloud](https://cloud.langfuse.com/) or [self-hosted](/content/self-hosting/index.html).
2. API credentials from your Langfuse project settings: hostname, public key, secret key

## Development

### Prerequisites

You need the following installed on your development machine:

- [git](https://git-scm.com/downloads)
- Node.js and npm. Minimum version Node 20. You can find instructions on how to install both using nvm (Node Version Manager) for Linux, Mac, and WSL [here](https://github.com/nvm-sh/nvm). For Windows users, refer to Microsoft's guide to [Install NodeJS on Windows](https://docs.microsoft.com/en-us/windows/dev-environment/javascript/nodejs-on-windows).
- Install n8n with:

```
npm install n8n -g
```

### Build new version

```
npm run build
npm link
```

### Test in local n8n

```
cd ~/.n8n/custom
npm link n8n-nodes-langfuse
```

## Resources

- [n8n community nodes documentation](https://docs.n8n.io/integrations/#community-nodes)
- [Langfuse documentation](/content/docs/index.html)
- [Langfuse Prompt Management](/content/docs/prompts/index.html)

## License

[MIT](https://github.com/langfuse/n8n-nodes-langfuse/blob/master/LICENSE.md)  
Source: [langfuse/n8n-nodes-langfuse](https://github.com/langfuse/n8n-nodes-langfuse)
