Using Langfuse prompts in n8n workflows

Pull managed Langfuse prompts into n8n with the Langfuse node so prompt changes do not require workflow edits, and plan around the current limits on tracing n8n runs.

On this page

How n8n workflows fetch Langfuse prompts without workflow edits

Prompts pasted into n8n nodes are hard to version, review or roll back, because every wording change becomes a workflow edit and a republish. The supported approach is the Langfuse node in n8n, which reads a managed prompt from your self-hosted Langfuse instance over its API at run time. The workflow references the prompt by name and label, such as production, so a team can move that label in Langfuse and the next execution uses the new text without anyone opening the canvas. The node reads prompts. It does not decide which version is approved, and it does not replace the access controls you set in Langfuse. Confirm the node's current operations and the Langfuse API fields it sends in your n8n version before you design around them.

Your n8n edition shapes that design. The n8n Sustainable Use License allows use for your own internal business purposes or non-commercial use, so a product you ship to customers needs legal review before you build it on the Community edition. Files with .ee in their name or directory require a valid n8n Enterprise License. SSO and LDAP, Git-based environments and log streaming are included only in the Business and Enterprise plans, so if prompt access must follow corporate identity, check the edition before you rely on it. In queue mode, every worker and webhook processor needs the main instance's encryption key to read stored credentials, and the Langfuse API credential is one of them, so include key handling in the rollout plan.

Tracing n8n runs is a separate question with its own limits. Langfuse accepts OpenTelemetry traces over OTLP at its /api/public/otel endpoint, so traces can arrive from any component that emits them, but fetching a prompt through the Langfuse node does not by itself record each workflow run as a trace. Whether a given n8n release emits OpenTelemetry spans or links model calls to the prompt version used is something to confirm in the n8n release notes and in a test run against your own Langfuse instance before you promise execution-level traces to a governance team. Until that is confirmed, treat run-level tracing as a gap and record the prompt name, label and version each workflow used in your own execution records.

What a self-hosted Langfuse and n8n pairing needs before setup

Before an n8n workflow can pull prompts from Langfuse, both platforms need to be in place and reachable from each other. The cards below cover the Langfuse stack, the version floor, the n8n license terms, project API keys, and the network and TLS path between them.

Langfuse stack components

A self-hosted Langfuse runs Langfuse Web for the UI and APIs, Langfuse Worker for asynchronous processing, PostgreSQL, ClickHouse, Redis or Valkey, and S3-compatible blob storage. The n8n node calls the Web container, so Web must be healthy and reachable, while the Worker and the data stores decide whether prompt versions and traces are stored and served reliably. Confirm each component is sized for your expected traffic before you add automations that fetch prompts on every run.

Langfuse self-hosting docs

Langfuse version floor

Confirm the Langfuse release you run meets the minimum for the Langfuse node and the SDK you use. The node version and the Langfuse release it expects are not fixed in this plan, so check the current node documentation in n8n and the Langfuse release notes before you pin versions. If you plan to move to Langfuse v4, check ClickHouse, PostgreSQL and Redis versions first, since the upgrade guide sets those floors.

Latest listed release
v4.63.0

n8n edition and license terms

n8n's free Community edition is self-hosted and licensed under the Sustainable Use License, which permits use only for your own internal business purposes or for non-commercial use. Commercial internal use is generally covered, but distributing the workflows or running them for customers is not, so confirm the terms with your legal team. Files with .ee in their name need a valid n8n Enterprise License, and SSO or Git environments require the Business or Enterprise plans.

n8n license text

Langfuse project API keys

The n8n Langfuse node authenticates with a public and secret key pair issued for one Langfuse project. Create a dedicated key pair for n8n rather than reusing a person's key, scope it to the project that holds the prompts, and store both values in n8n's credential store. Record who owns the key and plan rotation, because a revoked or rotated key stops every workflow that depends on it.

Network path from n8n to Langfuse

Confirm that every n8n main and worker process can reach the Langfuse Web endpoint on the port and hostname you configure, including across firewalls, proxies and any private DNS zone. Test from the same network segment where n8n runs, not from your laptop. Check that a prompt fetch succeeds from an n8n host before you build any workflow on top of it.

TLS trust and certificates

If Langfuse uses an internal certificate authority, n8n's runtime must trust that CA, or HTTPS calls from the Langfuse node will fail with certificate errors. Confirm the certificate chain includes the intermediate, that the hostname matches the name n8n uses, and that certificate renewal is planned. Test trust on every n8n host, including worker hosts if you run queue mode.

Configuring the Langfuse node and fetching a labeled prompt

This sequence connects an n8n workflow to a self-hosted Langfuse project, fetches a prompt by name and label, fills its variables from upstream data and passes the compiled text to a model node. The result is a workflow that runs whichever version the production label points to, so prompt changes do not require workflow edits.

  1. Create a project API key pair

    In your self-hosted Langfuse, open the project that holds the prompt and create a new API key pair from the project settings. Langfuse issues a public key and a secret key. Copy both values into your organization's secrets store as soon as they are displayed, and record which project they belong to. Ask your Langfuse administrator for project settings access if you cannot find the option. This step is done when you hold both keys and can name the project they came from.

  2. Confirm the self-hosted base URL

    Identify the address where your Langfuse web application is reachable from the host or container that runs n8n, including the scheme and any port. This can differ from the address people use in a browser when a reverse proxy or internal network sits in between, so do not assume they match. Send a simple request to that address from the n8n host. This step is done when the host receives a response from the Langfuse web application and the connection does not time out.

  3. Add the Langfuse credential in n8n

    In n8n, open the credentials area, create a new Langfuse credential and enter the self-hosted base URL, the public key and the secret key. Field labels can vary by n8n version, so match them to what your instance displays. Save the credential and run its connection test if the form offers one. This step is done when the credential saves without an error and the test passes, which confirms n8n can reach your Langfuse project with those keys.

  4. Confirm the prompt and production label

    In the Langfuse prompt library, confirm the exact prompt name the workflow will call and check that the version you reviewed carries the production label. The label is what lets the workflow pick up later changes without an edit. If you plan to protect production labels so that only certain roles can move them, that is an Enterprise license feature, so confirm your license before relying on it. This step is done when the production label points to the version you expect.

  5. Select the prompt by name and label

    Add the Langfuse node to the workflow, select the credential you created and choose the operation that fetches a prompt. Enter the prompt name and set the label to production. If the node offers a version field, leave it empty so the label decides which version runs. This step is done when the node settings show the name and label you chose and a test run returns the prompt text and its metadata.

  6. Map prompt variables from upstream nodes

    List the variables the prompt expects, such as a customer name or ticket text, and map each one to a field from an upstream node using n8n expressions. Keep variable names identical to the placeholders in the prompt, because a mismatch leaves the placeholder unfilled. Use illustrative sample data from a trigger to check the values. This step is done when a test run shows every variable replaced with the expected value in the compiled output.

  7. Send the compiled prompt to the model

    Connect the Langfuse node output to your model node and pass the compiled prompt text as the message content, keeping the message role the prompt defines. If your node version exposes model parameters stored in the prompt configuration, confirm that the model node reads them before you depend on them. Check the wiring against your own model setup. This step is done when the model node receives the compiled text and returns a response.

  8. Verify the prompt version in a test run

    Run the workflow manually with sample input and open the execution data. Confirm that the Langfuse node returned the version number carrying the production label and that the model node received the filled-in text. Then move the production label to a different version in Langfuse, run the workflow again and confirm the new version appears without any change to the workflow. Record both version numbers so you can match them against traces later. This step is done when both runs show the expected version.

Mapping prompt names, labels, variables and credentials between the two systems

This table maps each Langfuse prompt setting to the field it fills in an n8n workflow, and lists what to confirm in the node before production use. Read it as a checklist for the Langfuse node and its credential. The main takeaway is that a prompt change reaches a workflow only when the name, label or version, variables and credentials line up, and model settings need a separate check.

ItemHow it mapsConfirm in the node UI
Prompt nameUse the exact name the prompt has in Langfuse, since that is the identifier the node requests.Confirm whether the node takes the name as free text or a picker, and how it handles names with spaces or slashes.
Label or versionUse a label such as production to pick up prompt changes without editing the workflow, or pin a version for repeatable runs.Confirm which fields the node exposes and which one wins when both a label and a version are set.
Template variablesEach variable in the prompt needs a matching workflow field, such as an expression from the trigger or an earlier node.Confirm whether a missing or empty variable stops the run or sends blank text to the model.
Langfuse project and credentialOne n8n credential holds the Langfuse host and the key pair for one project, so the node reads prompts only from that project.Confirm the credential fields for your Langfuse version and use keys created for the intended project.
Credential encryption in queue moden8n encrypts stored credentials with the main instance key, so every worker and webhook processor needs that same key.Confirm the encryption key matches on all worker and webhook nodes before you enable queue mode.
Output passed to the model stepThe node returns prompt content that a downstream model node must send to the model.Confirm the output field the node returns and that your model node reads it, using a test execution.
Model configuration stored in the promptModel name, temperature and tool settings saved with the prompt may not be applied by the node, so the workflow's model node may still set them.Confirm whether the node returns prompt config and whether your model node uses it. Test with a sample run.

Tracing n8n runs: what is and is not captured today

This is the path with the clearest scope. The workflow calls Langfuse to retrieve a managed prompt by name and label, and the rest of the workflow sends that text to a model. Nothing about the model call has to reach Langfuse for this to work, so prompt releases can reach production without a workflow edit.

  • Read-only from n8n: the workflow requests the prompt version behind a label such as production, so moving the label in Langfuse changes what the next run receives.
  • Trace coverage is separate: a fetch does not create a trace for the model call that follows, so cost and latency for that call will not appear in Langfuse unless another path is added.
  • Credential handling: store the Langfuse keys as n8n credentials. In queue mode, the main instance's encryption key must be shared with every worker and webhook processor that reads them, as described in the n8n queue mode documentation.
  • Failure behavior: decide what the workflow does when the Langfuse host is unreachable. A failed fetch stops the run unless you build a fallback.

Check that the n8n version you run supports label-based fetching, and test your fallback path against a stopped Langfuse instance.

How a workflow run reads a prompt from Langfuse

A run starts at an n8n trigger, and the Langfuse node calls the self-hosted Langfuse web API to fetch the prompt version currently behind a label. The text and config come back into the workflow, which passes them to the model call. Optional tracing sends the generation back to Langfuse over the same boundary. Check that the label and the base URL point at your own instance, and that the n8n instance can reach it.

A workflow fetches a labeled prompt from self-hosted Langfuse and optionally traces the call back.

Securing the n8n to Langfuse connection

The n8n to Langfuse connection carries two kinds of trust: the Langfuse API keys that let a workflow read production prompts, and the n8n instance that stores those keys. The cards below cover key scope, credential storage, encryption across queue-mode workers, edit rights on workflows, and transport security, plus the license and plan features that change what you can enforce.

Scope API keys to one project

Langfuse API keys belong to a project, so a key issued for a staging project cannot read production prompts. Create a separate key pair for each n8n environment and for each Langfuse project the workflows touch. Record which workflow uses which key, so a rotation or revocation affects a known set of automations. Confirm in your own instance how keys are created and revoked for your Langfuse version. Project-level RBAC, which limits what a user can do inside a project, is an Enterprise license feature in self-hosted Langfuse.

License key docs

Store keys in n8n credentials

Put the Langfuse public and secret keys into an n8n credential rather than into expressions, Code node source or workflow variables that anyone with canvas access can open. Credentials are stored encrypted in the n8n database. Limit credential sharing to the people who maintain the automation, and remove credentials that a retired workflow no longer uses. Check the Langfuse node's credential fields for your n8n version before you build the first workflow.

Protect the n8n encryption key

In n8n queue mode, the main instance's encryption key must be shared with every worker and webhook processor so they can decrypt credentials stored in the database. Treat that key as the master secret for every stored Langfuse key. Keep it in your secrets manager, set the same value on each container or host, and never commit it to a repository. Losing it means stored credentials cannot be decrypted, and a leaked copy exposes every key n8n holds.

n8n queue mode docs

Restrict who edits production label workflows

A workflow that fetches the production label turns any edit to it into a change to a live prompt. Limit edit rights on those workflows to a small named group, and require a second reviewer for changes to the prompt name, label or fallback logic. Note that protected prompt labels, which restrict who can move a production label inside Langfuse, are an Enterprise license feature in self-hosted Langfuse. Without that feature, the control has to sit in your change process and in n8n's own access settings.

Confirm plan features in n8n

SSO and LDAP, environments with Git and log streaming are included only in n8n Business and Enterprise plans. Log streaming matters here because it lets you forward execution records that show when a workflow read a prompt. SAML single sign-on is available on those plans too, so accounts that edit prompt-fetching workflows can be tied to your identity provider. Confirm which n8n plan and license your organization holds before you rely on any of these controls.

n8n pricing

Use TLS to the Langfuse endpoint

The n8n Langfuse node sends keys and prompt content over HTTP to your Langfuse URL. Point it at an HTTPS address that terminates TLS at your reverse proxy or load balancer, and reject plain HTTP between n8n and Langfuse on your network. Check that the certificate chain is trusted by the n8n containers, because a self-signed certificate that works in a browser can still fail from a workflow. Confirm the exact base URL setting for your Langfuse version in the self-hosting documentation.

Langfuse self-hosting docs

Common failures when n8n reads Langfuse prompts

This table lists the symptoms teams most often see when an n8n workflow fetches a Langfuse prompt, with the likely cause and the fix for each. Use it as a first-pass checklist before changing keys, labels or certificates. The main takeaway is that most failures trace back to credentials, label names, or the network path between n8n and Langfuse, and each can be checked in order.

SymptomLikely causeFix
401 Unauthorized from the Langfuse nodePublic or secret key is wrong, belongs to another project, or the host URL points at a different Langfuse instanceRecreate the n8n Langfuse credential from the project's API keys page and confirm the base URL matches your self-hosted instance
Prompt not foundPrompt name is misspelled, uses a different folder path, or the requested label does not exist on that promptCopy the exact prompt name from the UI, then confirm the label such as production is set on the version you expect
Stale prompt after a label moveThe workflow fetched a cached copy, or a cache in n8n or an upstream step still holds the previous versionCheck whether caching is enabled in the node, lower the cache lifetime for testing, and re-run the workflow after the label change
Variables not substitutedVariable names in the prompt do not match the keys passed from n8n, or the expression resolved to emptyCompare each placeholder in the prompt with the input field names in the node, and log the compiled input before the call
Workers cannot decrypt credentials in queue modeThe main instance's encryption key is not set on worker and webhook processor nodes, so stored credentials cannot be readSet the same encryption key on every worker and webhook processor as on the main instance, then restart them and confirm the credential runs
Self-signed certificate errorsLangfuse is served behind an internal certificate authority that n8n's Node.js runtime does not trustAdd the internal CA to the trust store used by the n8n container or host, rather than disabling certificate checks in the workflow
Connection timeouts or intermittent failuresNetwork policy, proxy or DNS blocks the path from n8n to the Langfuse web address, or the Langfuse instance is under loadTest the URL from the n8n container, review egress rules, and check Langfuse web and worker health before changing the workflow

Questions teams ask before connecting Langfuse prompts to n8n

Can our team connect Langfuse prompts to n8n without outside help?

Yes, if someone on the team is comfortable with n8n credentials, HTTP requests and Langfuse project API keys. The core steps are configuration, so an engineer who has built n8n workflows can usually manage the first one. The harder parts sit around the workflow: deciding who may move production labels, handling the n8n encryption key if you run queue mode, and confirming the license terms for your use. Teams with many workflows across several environments often find that the second and third workflows go faster than the first. Plan time for testing failure paths, such as what a workflow does when Langfuse is unreachable or a label points to a missing prompt.

What makes an n8n and Langfuse prompt project cost more?

Four factors drive the effort most:

  • The number of workflows that read prompts, and how many of them run in production.
  • The number of variables each prompt takes and how much logic sits between the prompt and the model call.
  • The tracing scope you want, including whether n8n runs themselves must appear in Langfuse.
  • License and network work, such as Enterprise features in Langfuse, SSO for n8n, and routes between n8n workers and the Langfuse server.

Each of these becomes a line in a written scope, and a quote follows from that scope. DeployOpen does not publish a price list. Ask the partner to break the quote down by workflow, environment and testing, and to show which items are one-time work and which are ongoing support.

Is a fixed-scope engagement the usual way to hire a partner?

Yes. Most DeployOpen engagements are fixed-scope, with scope, deliverables and timelines agreed in writing before work starts. For this topic, the written scope would normally list the workflows in scope, the prompts and labels they read, the n8n deployment mode, the Langfuse deployment they connect to, and the checks that show a prompt change reaches a workflow. Changes found after kickoff should go through a written change to the scope, so cost and timing stay visible. Ongoing support, upgrades and continuous testing are available as retainers. Ask for the timeline in writing, since no duration is set for this work here.

What do we need to give a partner before work starts?

A partner needs enough access to build and test without touching production data:

  • Administrator access to the n8n instance, and a plan for handling the encryption key if you run queue mode.
  • Access to the self-hosted Langfuse project, with API keys scoped to a test project first.
  • A list of the workflows that will read prompts, along with the prompts and labels they use.
  • Named owners who can approve changes to production labels.
  • Network paths from every n8n node that fetches prompts to the Langfuse server, and a test environment that mirrors production.

Agree in advance who holds each secret and where it is stored, so the handover does not depend on one person.

How do prompt changes reach workflows that are already running?

A workflow receives the prompt that the Langfuse node returns when it runs, so moving a label in Langfuse changes what the next run receives. The workflow itself does not need an edit. Confirm with the node documentation whether it caches prompts and for how long, because caching decides how quickly a change reaches running workflows. A bad label move affects every run that reads that label, so control over production labels matters as much as the workflow design. Protected prompt labels and project-level roles are Enterprise license features in self-hosted Langfuse, so confirm which of these your organization needs before you plan the change process.

What do the n8n license terms mean for internal use?

n8n is licensed under the Sustainable Use License, which permits use or modification for your own internal business purposes, along with non-commercial or personal use. Running n8n to automate your organization's internal work generally fits those terms. Distribution is allowed only free of charge and for non-commercial purposes, so offering n8n-based services to customers needs a separate review. Files with .ee in their name or directory are outside that license and need a valid n8n Enterprise License. The pricing page lists the Business plan as self-hosted only, with SSO and LDAP included in Business and Enterprise. Have your legal team confirm how the terms apply to your use before rollout.

Can n8n runs be traced in Langfuse today?

The facts available here do not confirm a built-in way to trace whole n8n runs in Langfuse, so confirm the current behavior in the Langfuse node documentation and the n8n release notes before you promise it internally. Langfuse does accept OpenTelemetry traces over OTLP, so an OTEL-capable component may be able to send data, but whether your n8n version can emit it is something to test. Separate two questions: tracing prompt usage and model calls, which the prompt node may cover, and tracing every n8n step, which may need extra work. Write down which of the two your organization needs, and test it on a non-production workflow first.

Does n8n queue mode change how Langfuse prompts are fetched?

In queue mode, the main instance handles triggers and webhooks, and executions pass through Redis to a pool of workers that read and write workflow data in PostgreSQL. Any worker that runs a prompt fetch must reach the Langfuse server, so test the network path from every worker, not only from the main instance. The n8n encryption key must also be shared with all worker and webhook processor nodes so they can read stored credentials, which affects where the Langfuse API key is kept. Multi-main setups for high availability are limited to Enterprise self-hosted deployments, so check the plan you have before you design failover around them.

How DeployOpen scopes and delivers the Langfuse and n8n connection

DeployOpen treats the Langfuse prompt pull and the n8n workflow as one connected change inside your infrastructure. We scope the self-hosted Langfuse instance, the n8n instance and the workflows that fetch prompts, then build and test them together so prompt releases stop depending on workflow edits.

How we scope

  • Written scope names the n8n workflows that will fetch prompts and the Langfuse projects and labels they read from
  • We record which n8n edition and license you run, since the Langfuse node and its configuration depend on it
  • The scope states what tracing of n8n runs is in and out of the agreed work, given current limits
  • Fixed-scope terms, deliverables and timelines are agreed in writing before any build work starts

How we build

  • Credentials for Langfuse are stored in n8n and handled with the same encryption key rules as your other secrets
  • We build the prompt fetch step, fallback behavior when Langfuse is unreachable, and test each workflow path before release
  • Queue mode and worker settings are checked so workers can read stored credentials when executions run in parallel
  • Prompt label changes are tested to confirm workflows pick up the new version without any workflow edit

How we hand over

  • Handover documents the workflows, credential ownership, label names and the procedure for moving a prompt label
  • Runbooks cover what to check when a prompt fetch fails and where execution logs are kept for review
  • Your team receives a record of which tracing gaps remain for n8n runs, so expectations are explicit
  • Walkthroughs are run with the people who will edit prompts and the people who will maintain n8n

How we support

  • Ongoing support, upgrades and continuous testing are available as retainers after handover
  • Retainers can cover n8n upgrades, Langfuse upgrades and re-testing of prompt-fetch workflows after changes
  • Changes to the agreed scope are documented and quoted in writing before they are built
  • Quotes follow from the written scope, so ask for the scope and deliverables list before comparing offers

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.