n8n

How to Automate GitHub Prompt Content Creation?

Turn version controlled prompt files into ready AI outputs with one click. Great for marketing and content teams that keep templates in GitHub and want fast, consistent generation.

The flow pulls a selected file from a GitHub repo, reads the text, finds all placeholders inside double braces, and checks if every required variable is set. If anything is missing, it stops and shows which keys you need. When all keys are present, it replaces the variables, builds the final prompt, and sends it to an AI agent powered by an Ollama chat model. The response is captured as a clean field you can pass to other steps or export. This design keeps prompts organized, prevents broken runs, and makes content generation repeatable at scale.

Set up a GitHub repo with your prompt templates and define variables in the set node. Connect your Ollama server that n8n can reach from the cloud. Expect faster content prep, fewer mistakes, and a clear audit trail in GitHub. Use it for blog drafts, product copy, ad variations, or campaign briefs that need standard formats.

What are the key features?

  • Manual start for safe test runs while you fine tune templates and variables
  • GitHub file fetch loads a specific prompt file using owner, repo, and path fields
  • File text extraction converts the repository file into clean text for processing
  • Automatic variable scan detects all placeholders inside double braces and lists missing keys
  • Guardrail If node stops the run and returns a clear error message when data is missing
  • Variable replacement builds a final prompt with your set values before sending to AI
  • AI Agent with Ollama chat model generates the response and stores it as promptResponse

What are the benefits?

  • Reduce prompt prep from 30 minutes to 2 minutes by pulling templates directly from GitHub
  • Eliminate missing field errors with 100% variable checks before any AI run
  • Streamline content production by 60% through reusable templates and one click runs
  • Handle 10 times more prompt templates with version control and simple inputs
  • Connect GitHub and Ollama so teams use the same source of truth for prompts

How do you set it up?

  1. Import the template into n8n: Create a new workflow in n8n > Click the three dots menu > Select 'Import from File' > Choose the downloaded JSON file.
  2. You'll need accounts with GitHub and Ollama. See the Tools Required section above for links to create accounts with these services.
  3. Prepare your GitHub repository: add a folder and a prompt file that contains placeholders like {{ product_name }} and {{ tone }}.
  4. Open the GitHub node in n8n and set the owner, repository, and file path fields to match your repo structure.
  5. In the n8n credentials manager, create a GitHub credential. Use a personal access token with read repo access or follow the on screen setup. Name the credential clearly, for example GitHub Read Only.
  6. Update the setVars node with your default values such as Account, repo, path, prompt filename, and any prompt variables you want to fill.
  7. Set up the Ollama connection: double click the Ollama Chat Model credential field, click Create new credential, then enter your Ollama base URL. On n8n Cloud this must be a public URL reachable from the internet.
  8. Select your desired Ollama model name in the Ollama Chat Model node, such as a local LLM you have installed on your server.
  9. Run a test using the manual trigger. Watch the nodes Check All Prompt Vars Present and If to confirm that no variables are missing.
  10. If the workflow stops with an error, read the listed missing keys and add them to the setVars node, then test again.
  11. Verify the AI result in the Prompt Output node. The field promptResponse should contain the generated content.
  12. Troubleshoot common issues: if GitHub returns not found, confirm owner, repo, and path. If the AI node fails to connect, confirm the Ollama URL is reachable and the model name is correct.

Tools Required

$24 / mo or $20 / mo billed annually to use n8n in the cloud. However, the local or self-hosted n8n Community Edition is free.

GitHub

Sign up

Free tier: $0 / mo

Ollama

Sign up

Free tier: $0 (self-hosted local API)

Similar Templates

Join Futurise to access 1,200+ automation templates

Get instant access to ready-made automation workflows for n8n, Make.com, AI agents, and more. Download, customise, and deploy in minutes.