Fetch dynamic prompts from GitHub and auto-populate n8n expressions in prompt
Needs changesWhat this workflow does
This AI workflow has 13 nodes and runs manually, when you click “Execute workflow”. Along the way it connects GitHub and Ollama Chat Model.
How it runs
Trigger: Manually, when you click “Execute workflow”.
- setVars (Edit Fields (Set)): sets 8 fields: Account, repo, path…
- GitHub: get (file)
- Extract from File: extracts data from a file (text)
- SetPrompt (Edit Fields (Set)): sets 1 field: data
- Check All Prompt Vars Present (Code): runs custom JavaScript code
- If: checks a condition and branches into true / false
- replace variables (Code): runs custom JavaScript code
- Stop and Error: stops the run with an error
- Set Completed Prompt (Edit Fields (Set)): sets 1 field: Prompt
- AI Agent: runs an AI agent, with model: Ollama Chat Model
…plus 1 more step. See the full node list below.
Services it uses
Before you upgrade to n8n 3.0
1 thing in this workflow is removed in n8n 3.0. Fix it before you upgrade:
- AI Agent v1 (old agent modes) in AI Agent (v1.7): replace with Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent.
Rather not rewrite it? Many of these flows can be rebuilt in Make (free plan).
Published 2025 — 19% of 2025 templates need changes for 3.0. See how template age affects 3.0 readiness →
| Removed in 3.0 | Replace with |
|---|---|
| AI Agent v1 (old agent modes) AI Agent (v1.7) | Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent. |
Nodes used (9)
- Manual Trigger
n8n-nodes-base.manualTrigger - GitHub
n8n-nodes-base.github - Extract from File
n8n-nodes-base.extractFromFile - Edit Fields (Set)
n8n-nodes-base.set - Code
n8n-nodes-base.code - If
n8n-nodes-base.if - Stop and Error
n8n-nodes-base.stopAndError - AI Agent
@n8n/n8n-nodes-langchain.agent - Ollama Chat Model
@n8n/n8n-nodes-langchain.lmChatOllama
From the author
Who Is This For? This workflow is designed for AI engineers, automation specialists, and content creators who need a scalable system to dynamically manage prompts stored in GitHub. It eliminates manual updates, enforces required variable checks, and ensures…