Load Github Prompts and Auto-Populate n8n Expressions
detail.loadingPreview
This workflow retrieves prompt files from a GitHub repository, checks for missing variables, and uses an AI agent to generate responses. It streamlines prompt management and dynamic content generation.
🚀Ready to Deploy This Workflow?
About This Workflow
Overview
This n8n workflow automates the process of loading prompts from a GitHub repository and dynamically populating them with variables before sending them to an AI agent. It starts by defining variables in a setVars node, then fetches a specified prompt file from GitHub using the GitHub node. The Extract from File node processes the content, which is then checked for variable completeness using Check All Prompt Vars Present. If all variables are present, the replace variables node substitutes placeholders in the prompt with the defined variables. An If node routes the workflow: if successful, the prompt is sent to an AI agent (like an Ollama model) for processing; if variables are missing, it stops with an error message indicating which variables are absent.
This workflow solves the problem of manually managing prompts and their associated variables. It enables more efficient and error-free dynamic content generation by ensuring all necessary data is available before execution and by leveraging external prompt repositories.
Key Features
- Fetches prompt files directly from GitHub repositories.
- Dynamically checks for the presence of all required variables in prompts.
- Automatically replaces placeholders in prompts with defined variables.
- Integrates with AI agents (e.g., Langchain/Ollama) for prompt execution.
- Provides clear error handling for missing variables.
How To Use
- Configure
setVarsNode: Define your project-specific variables (e.g.,company,repo,path,prompt,product,features,sector). - Set Github Credentials: Ensure your GitHub API credentials are set up in n8n.
- Adjust GitHub Node: Update the
owner,repository, andfilePathparameters in theGitHubnode to point to your desired prompt file. - Review
Check All Prompt Vars PresentNode: This node automatically extracts variables from your prompt file (e.g.,{{ company }}). Ensure the variables you define insetVarsmatch these placeholders. - Configure
replace variablesNode: Verify thejsCodecorrectly maps yoursetVarsvalues to the prompt placeholders. - Choose and Configure AI Node: Select your preferred AI node (e.g.,
AI AgentorOllama Chat Model) and configure its parameters. Ensure thetextinput correctly references the output of thereplace variablesnode. - Test Workflow: Click 'Test workflow' to execute the automation.
Apps Used
Workflow JSON
{
"id": "f17ff9eb-f885-4070-97d0-e567a848a67b",
"name": "Load Github Prompts and Auto-Populate n8n Expressions",
"nodes": 0,
"category": "AI and LLMs",
"status": "active",
"version": "1.0.0"
}Note: This is a sample preview. The full workflow JSON contains node configurations, credentials placeholders, and execution logic.
Get This Workflow
ID: f17ff9eb-f885...
About the Author
AI_Workflow_Bot
LLM Specialist
Building complex chains with OpenAI, Claude, and LangChain.
Statistics
Verification Info
Related Workflows
Discover more workflows you might like
Automated QA Generation for n8n Integrations using OpenAI
This workflow automates the creation of Question & Answer (QA) pairs for n8n integrations. It uses the OpenAI Chat Model to enrich answers and Google Sheets to manage integration data, streamlining documentation.
n8n Langchain AI Agent with Web Search Capabilities
Build an interactive AI agent in n8n using Langchain, capable of responding to chat messages, remembering conversations with Window Buffer Memory, and performing web searches via SerpAPI.
AI-Powered Podcast Digest: Summarize Transcripts with n8n
This n8n workflow automates the summarization of podcast transcripts using AI. It takes raw transcript text and processes it to generate concise digests, making lengthy audio content more accessible.