Skip to content

Instantly share code, notes, and snippets.

@miolamio
Created November 23, 2025 08:09
Show Gist options
  • Select an option

  • Save miolamio/3aa18f134a116948c93eaaba31e13e0f to your computer and use it in GitHub Desktop.

Select an option

Save miolamio/3aa18f134a116948c93eaaba31e13e0f to your computer and use it in GitHub Desktop.
Fetching Prompts from n8n
// Function Node: Fetch LangFuse Prompt
const response = await $http.request({
method: 'GET',
url: 'https://cloud.langfuse.com/api/public/v2/prompts/player-support-agent',
headers: {
'Authorization': `Basic ${Buffer.from(
`${$credentials('langfuse').publicKey}:${$credentials('langfuse').secretKey}`
).toString('base64')}`
},
qs: {
label: 'production'
}
});
const promptTemplate = response.prompt;
const compiledPrompt = promptTemplate
.replace('{playerName}', $json.playerName)
.replace('{issue}', $json.issue);
return [{ json: { prompt: compiledPrompt } }];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment