# Automate code reviews for GitLab MRs with Gemini and Jira: n8n workflow

> Started by another system calling it, and works across Jira. It hands the judgement calls to Gemini.

Source: https://millionrounds.com/workflow/automate-code-reviews-for-gitlab-mrs-with-gemini-and-jira (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)

# Automate code reviews for GitLab MRs with Gemini and Jira

Started by another system calling it, and works across Jira. It hands the judgement calls to Gemini. 35 steps, 4 branches: large, and worth reading before you trust it with anything live.

Large Calls a model: Gemini

[Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fautomate-code-reviews-for-gitlab-mrs-with-gemini-and-jira)

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

**4** Branches: places the flow splits

**0** Loops or waits

**1** Service it connects to

## The flow

Starts it 2 Model 2 Logic 23 Service 8

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

- 1 **Google Gemini Chat Model** Lm Chat Google Gemini *Model*
- 2 **Error Trigger** Error trigger *Starts it*
- 3 **Listen For Gitlab Comments** Webhook *Starts it*
- 4 **Basic LLM Chain** Chain Llm *Model*
- 5 **Get Static Context Including Error** Code *Logic*
- 6 **Need Review** If *Logic*
- 7 **Merge LLM Output with Input** Merge *Logic*
- 8 **Post Error Occurred** Http Request *Service*
- 9 **Set workflow execution information** Code *Logic*
- 10 **Aggregate** Aggregate *Logic*
- 11 **Cleanup Static Context** Code *Logic*
- 12 **Post Review Started** Http Request *Service*
- 13 **Extract MR Details** Set *Logic*
- 14 **Process Comments** Code *Logic*
- 15 **Get MR Changes** Http Request *Service*
- 16 **Extract the JIRA Issue ID** Code *Logic*
- 17 **Any Issues Found?** If *Logic*
- 18 **Merge** Merge *Logic*
- 19 **Get JIRA issue** Jira *Service*
- 20 **Get Static Context** Code *Logic*
- 21 **Split Out Comments** Split Out *Logic*
- 22 **Split Out Changes** Split Out *Logic*
- 23 **Format JIRA Context** Set *Logic*
- 24 **If JIRA Subtask** If *Logic*
- 25 **Post No Issues Found** Http Request *Service*
- 26 **Prepare Request** Code *Logic*
- 27 **Skip File Changes** If *Logic*
- 28 **Get JIRA Parent Issue** Jira *Service*
- 29 **Post Gitlab MR Comments** Http Request *Service*
- 30 **Parse Diff** Code *Logic*
- 31 **Format JIRA Parent Context** Set *Logic*
- 32 **Prepare Request Without Position** Code *Logic*
- 33 **Prepare Code Changes** Code *Logic*
- 34 **Post Gitlab MR Comments WIthout Position** Http Request *Service*
- 35 **Filter Irrelevant Fields** Set *Logic*

## How it's built

- **Starts on:** Another system calling it
- **Steps:** 35, with 4 branches
- **Size:** Large: read it before trusting it with anything live
- **Connects to:** Jira
- **Model:** Gemini

## Questions

What does it need to run?

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

What starts it?

It starts on another system calling it.

Does it use AI?

Yes. It calls Gemini. Model calls are billed by the provider, not by n8n.

How long does it take to set up?

Take your time. At 35 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 35 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%2Fautomate-code-reviews-for-gitlab-mrs-with-gemini-and-jira)
- **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.

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

## Workflows like it

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

- [**Automate agile project setup with OpenAI and Jira** 32 steps · calls a model · Gmail, Jira](https://millionrounds.com/workflow/automate-agile-project-setup-with-openai-and-jira)
- [**Convert DevOps Mattermost requests into Jira tasks** 15 steps · calls a model · Jira, Mattermost](https://millionrounds.com/workflow/convert-devops-mattermost-requests-into-jira-tasks)
- [**Triage and retry failed workflow executions with Anthropic** 15 steps · calls a model · Jira](https://millionrounds.com/workflow/triage-and-retry-failed-workflow-executions-with-anthropic)
- [**Triage Microsoft 365 incidents into Jira with OpenAI** 12 steps · calls a model · Jira](https://millionrounds.com/workflow/triage-microsoft-365-incidents-into-jira-with-openai)
- [**The AI QA Suite: Agentic Test Case Generation for Jira** 7 steps · calls a model · Jira](https://millionrounds.com/workflow/the-ai-qa-suite-agentic-test-case-generation-for-jira)
