n8n

How to Automate GitHub AI Content Generation?

Pull AI prompt templates from GitHub, fill in variables, and run them on a local model. Teams use it to keep prompts in one place and get consistent results. Great for content drafts, support replies, and internal notes.

You start the run with a manual click. The flow loads a text file from your repo, reads the content, and looks for any placeholder like {{name}}. It checks that all required fields are set and stops with a clear list if something is missing. When everything is present, it replaces the values, sends the final text to an AI Agent that uses Ollama, and captures the answer for you. Variable checks reduce mistakes before the model is called, and repo storage keeps version control in place.

Set your repo owner, name, file path, and file name in one place. Connect your GitHub account and an Ollama endpoint, then test. Expect fewer errors, faster drafts, and easier reuse of templates across many teams. This fits teams that treat prompts like code and want consistent, traceable AI output.

What are the key features?

  • Manual start to test and run prompts on demand
  • Fetches a text file from GitHub using repo, path, and file name
  • Reads file content and detects placeholders inside double braces
  • Validates required variables and stops with a clear missing keys list
  • Replaces placeholders with your set values before sending to the model
  • Sends the completed prompt to an AI Agent powered by Ollama
  • Captures the AI response in a dedicated output field for easy reuse

What are the benefits?

  • Reduce manual work from 30 minutes to 3 minutes per prompt by reusing templates
  • Eliminate up to 90 percent of missing variable errors with built in checks
  • Connect GitHub and Ollama in one flow for faster AI runs
  • Scale to dozens of prompt templates without extra steps
  • Keep prompts version controlled and traceable in GitHub

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 text prompt file with placeholders like {{customer_name}} and note its folder path and filename.
  4. Open the GitHub node in n8n. In the credential field, click Create new credential. Use OAuth2 or a Personal Access Token with read repo scope. Follow on screen steps, save, and test the connection.
  5. Open the Ollama Chat Model node. In the credential field, click Create new credential. Enter your Ollama base URL such as http://localhost:11434 and any required token. Save and test the connection.
  6. Open the setVars node. Fill in owner account name, repository name, file path, and prompt filename to match your repo.
  7. Confirm the GitHub node fields: owner, repository, and filePath are mapped from the setVars values. Ensure the path plus filename matches your repo structure.
  8. Click Test workflow. Check the Extract from File node to confirm the prompt text was read correctly.
  9. If you see a Stop and Error with missing variables, update the setVars values or edit the prompt file so all placeholders have matching values.
  10. Verify Ollama is running and the selected model is available. Pull the model in your Ollama environment if needed, then run the workflow again.
  11. Review the AI Agent result in the Prompt Output node. Copy the response or pass it to your next steps.
  12. Troubleshooting: a 404 from GitHub means the path or filename is wrong. Empty output means the file is not plain text. Connection refused for Ollama means the server is not reachable from n8n.

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.