# Analyse GitHub PRs for vulnerabilities with OpenAI and Slack: n8n workflow

> Started by an event in a connected app, and works across GitHub and Slack. It hands the judgement calls to OpenAI.

Source: https://millionrounds.com/workflow/analyse-github-prs-for-vulnerabilities-with-openai-and-slack (Millionrounds; every figure on the page links to its filing or article)

[Automation library](https://millionrounds.com/workflows) · [Research and reporting](https://millionrounds.com/workflows?category=Research+and+reporting#library)

# Analyse GitHub PRs for vulnerabilities with OpenAI and Slack

Started by an event in a connected app, and works across GitHub and Slack. It hands the judgement calls to OpenAI. 18 steps, 3 branches: a working afternoon to understand properly.

Medium Calls a model: OpenAI

[Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fanalyse-github-prs-for-vulnerabilities-with-openai-and-slack)

**18 steps** Medium: a working afternoon

**3** Branches: places the flow splits

**0** Loops or waits

**2** Services it connects to

## The flow

Starts it 2 Model 5 Logic 7 Service 4

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

- 1 **Execute Workflow Trigger** Execute Workflow trigger *Starts it*
- 2 **Format Output** Output Parser Structured *Model*
- 3 **Understand Github PRs** Tool Workflow *Model*
- 4 **OpenAI Chat Model** Lm Chat Open Ai *Model*
- 5 **Get Pull Request Diff** Tool Workflow *Model*
- 6 **On Pull Request Events...** Github trigger *Starts it*
- 7 **Tools Router** Switch *Logic*
- 8 **Analyse Git Diff For Vulnerabilities** Agent *Model*
- 9 **Only If Opened or Edited...** If *Logic*
- 10 **Get PR reviews** Github *Service*
- 11 **Get diff from Github** Http Request *Service*
- 12 **Comment on issue in Github** Github *Service*
- 13 **Filter Human Messages** Filter *Logic*
- 14 **Get Pull Request Diff Response** Set *Logic*
- 15 **Problem detected?** If *Logic*
- 16 **Aggregate PR Reviews** Aggregate *Logic*
- 17 **Send message to #medic channel** Slack *Service*
- 18 **Get Understand PR Response** Set *Logic*

## How it's built

- **Starts on:** An event in a connected app
- **Steps:** 18, with 3 branches
- **Size:** Medium: a working afternoon
- **Connects to:** GitHub, Slack
- **Model:** OpenAI

## Questions

What does it need to run?

An n8n account, plus your own GitHub and Slack accounts, 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. Model calls are billed by the provider, not by n8n.

How long does it take to set up?

Plan an afternoon. 18 steps is enough that you should read each one before running it.

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 18 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%2Fanalyse-github-prs-for-vulnerabilities-with-openai-and-slack)
- **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.

## Connects to

Each opens the other workflows that use it.

[GitHub](https://millionrounds.com/workflows?service=GitHub#library)[Slack](https://millionrounds.com/workflows?service=Slack#library)

## Workflows like it

Also research and reporting, with the same services where possible, closest in size first.

- [**Food Photo Analysis to Restaurant & Book Recommendations** 18 steps · calls a model · Slack](https://millionrounds.com/workflow/food-photo-analysis-to-restaurant-and-book-recommendations)
- [**Track competitor pricing and features with BrowserAct** 18 steps · calls a model · Google Sheets, Slack](https://millionrounds.com/workflow/track-competitor-pricing-and-features-with-browseract)
- [**Automate actuarial premium adjustments and claims reporting** 19 steps · calls a model · Gmail, Slack](https://millionrounds.com/workflow/automate-actuarial-premium-adjustments-and-claims-reporting)
- [**Document summarizer - Google Drive to Slack with OpenAI** 17 steps · calls a model · Google Drive, Google Sheets](https://millionrounds.com/workflow/document-summarizer-google-drive-to-slack-with-openai)
- [**Generate carbon emissions reports with OpenAI and Slack** 17 steps · calls a model · Slack](https://millionrounds.com/workflow/generate-carbon-emissions-reports-with-openai-and-slack)
- [**Generate cited web research reports with SerpAPI and Claude** 19 steps · calls a model · Google Docs, Postgres](https://millionrounds.com/workflow/generate-cited-web-research-reports-with-serpapi-and-claude)
