# GitHub repository AI agent with OpenAI: n8n workflow template

> Started by an event in a connected app. It calls services over plain HTTP rather than through connectors.

Source: https://millionrounds.com/workflow/github-repository-ai-agent-with-openai (Millionrounds; every figure on the page links to its filing or article)

[Automation library](https://millionrounds.com/workflows) · [AI assistants](https://millionrounds.com/workflows?category=AI+assistants#library)

# GitHub repository AI agent with OpenAI

Started by an event in a connected app. It calls services over plain HTTP rather than through connectors. It puts OpenAI behind a retrieval step, so answers are drawn from documents you supply rather than from the model alone. 28 steps: large, and worth reading before you trust it with anything live.

Large Calls a model: OpenAI Retrieval

[Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fgithub-repository-ai-agent-with-openai)

**28 steps** Large: read it before trusting it with anything live

**0** Branches: places the flow splits

**0** Loops or waits

**0** Services by connector: it calls them over plain HTTP

## The flow

Starts it 1 Model 3 Service 24

The steps in the order they run, from what starts it.

- 1 **When Executed by Another Workflow** Execute Workflow trigger *Starts it*
- 2 **OpenAI Chat Model** Lm Chat Open Ai *Model*
- 3 **Agent Memory** Memory Buffer Window *Model*
- 4 **Get Repository** Github Tool *Service*
- 5 **Create File** Github Tool *Service*
- 6 **Get File Contents** Github Tool *Service*
- 7 **Edit File** Github Tool *Service*
- 8 **Delete File** Github Tool *Service*
- 9 **List Files** Github Tool *Service*
- 10 **List Issues** Github Tool *Service*
- 11 **Get Issue** Github Tool *Service*
- 12 **Create Issue** Github Tool *Service*
- 13 **Edit Issue** Github Tool *Service*
- 14 **Comment on Issue** Github Tool *Service*
- 15 **Lock Issue** Github Tool *Service*
- 16 **List Releases** Github Tool *Service*
- 17 **Get Release** Github Tool *Service*
- 18 **Create Release** Github Tool *Service*
- 19 **Update Release** Github Tool *Service*
- 20 **Delete Release** Github Tool *Service*
- 21 **Get Review** Github Tool *Service*
- 22 **List Reviews** Github Tool *Service*
- 23 **Create Review** Github Tool *Service*
- 24 **Update Review** Github Tool *Service*
- 25 **Get User Repos** Github Tool *Service*
- 26 **Invite User** Github Tool *Service*
- 27 **Get Org Repos** Github Tool *Service*
- 28 **GitHub Agent** Agent *Model*

## How it's built

- **Starts on:** An event in a connected app
- **Steps:** 28
- **Size:** Large: read it before trusting it with anything live
- **Connects to:** Nothing by connector; it calls services over plain HTTP
- **Model:** OpenAI
- **Retrieval:** Answers are drawn from documents you supply, not from the model alone

## Questions

What does it need to run?

An n8n account, and a key for OpenAI. You connect your own accounts after importing it; none are included.

What starts it?

It starts on an event in a connected app.

Does it use AI?

Yes. It calls OpenAI. Its answers draw on documents you give it, not on the model alone. Model calls are billed by the provider, not by n8n.

How long does it take to set up?

Take your time. At 28 steps it is large: read it before trusting it with anything live.

How do I import it?

Copy the workflow, open a new workflow in n8n and paste. The steps appear on the canvas, ready for your own accounts.

**Before you run it**

Nothing here has been tested by us. It is somebody's working automation, read and described from its own steps. Treat the connections it wants as a list of accounts it will touch, and read the 28 steps before you point it at anything that matters.

## Run it in n8n

- **Create your n8n account** Free to start. n8n is where the workflow runs. [Create an n8n account ↗](https://millionrounds.com/n8n)
- **Download the workflow** Free with a Millionrounds account. [Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fgithub-repository-ai-agent-with-openai)
- **Paste it into n8n** Open a new workflow in n8n and paste. Then connect your own accounts.

Stored with the author's traces removed: canvas notes, instance identifiers, saved credential names and any live document they had left behind.

## Workflows like it

Also ai assistants, with the same services where possible, closest in size first.

- [**Create an AI chatbot for WhatsApp with Whapi.Cloud and OpenAI** 28 steps · calls a model](https://millionrounds.com/workflow/create-an-ai-chatbot-for-whatsapp-with-whapi-cloud-and-opena)
- [**Dynamic website assistant with DeepSeek** 28 steps · calls a model · Pinecone](https://millionrounds.com/workflow/dynamic-website-assistant-with-deepseek)
- [**Triage and label Gmail emails with OpenAI** 28 steps · calls a model · Gmail](https://millionrounds.com/workflow/triage-and-label-gmail-emails-with-openai)
- [**AI chatbot call center: Demo call center with Grok and Redis** 27 steps · calls a model · Redis](https://millionrounds.com/workflow/ai-chatbot-call-center-demo-call-center-with-grok-and-redis)
- [**AI voice & text note-taking with LINE Messaging** 27 steps · calls a model · Gmail, Supabase vectors](https://millionrounds.com/workflow/ai-voice-and-text-note-taking-with-line-messaging)
- [**Automatic LinkedIn engagement with OpenAI and Phantombuster** 29 steps · calls a model](https://millionrounds.com/workflow/automatic-linkedin-engagement-with-openai-and-phantombuster)
