Created
November 23, 2025 08:09
-
-
Save miolamio/3aa18f134a116948c93eaaba31e13e0f to your computer and use it in GitHub Desktop.
Fetching Prompts from n8n
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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