Created
May 26, 2025 09:17
-
-
Save PaulSec/9cfcc24f64145612d3e499ec6aade29b to your computer and use it in GitHub Desktop.
Here is a configuration file in order to use AzureOpenAI to act as a Tech Lead and make code recommendations in Gitlab
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "Workflow Copy", | |
"nodes": [ | |
{ | |
"parameters": { | |
"owner": "REDACTED_OWNER", | |
"repository": "REDACTED_REPOSITORY", | |
"events": [ | |
"merge_requests" | |
] | |
}, | |
"type": "n8n-nodes-base.gitlabTrigger", | |
"typeVersion": 1, | |
"position": [0, 0], | |
"id": "46602155-b8b8-4af9-a476-707f2b3fef60", | |
"name": "GitLab Trigger", | |
"webhookId": "REDACTED_WEBHOOK_ID", | |
"credentials": { | |
"gitlabApi": { | |
"id": "REDACTED_CREDENTIAL_ID", | |
"name": "REDACTED_CREDENTIAL_NAME" | |
} | |
} | |
}, | |
{ | |
"parameters": { | |
"assignments": { | |
"assignments": [ | |
{ | |
"id": "1e71ceb9-4270-4410-a0b2-a79499a2a3cb", | |
"name": "PROJECT_ID", | |
"value": "={{ $json.body.project.id }}", | |
"type": "string" | |
}, | |
{ | |
"id": "393690b1-380e-4052-9ae0-acc84f8b63e7", | |
"name": "MR_ID", | |
"value": "={{ $json.body.object_attributes.iid }}", | |
"type": "string" | |
} | |
] | |
}, | |
"options": {} | |
}, | |
"type": "n8n-nodes-base.set", | |
"typeVersion": 3.4, | |
"position": [220, 0], | |
"id": "64433974-7e6a-407c-b8ff-c33d411a7509", | |
"name": "Edit Fields" | |
}, | |
{ | |
"parameters": { | |
"url": "=https://gitlab.com/api/v4/projects/{{$json.PROJECT_ID}}/merge_requests/{{$json.MR_ID}}/changes", | |
"sendHeaders": true, | |
"headerParameters": { | |
"parameters": [ | |
{ | |
"name": "PRIVATE-TOKEN", | |
"value": "REDACTED_TOKEN" | |
} | |
] | |
}, | |
"options": {} | |
}, | |
"type": "n8n-nodes-base.httpRequest", | |
"typeVersion": 4.2, | |
"position": [440, 0], | |
"id": "76c12fa1-a026-4b85-bb58-0c894fb41160", | |
"name": "HTTP Request" | |
}, | |
{ | |
"parameters": { | |
"model": "gpt-35-turbo", | |
"options": {} | |
}, | |
"type": "@n8n/n8n-nodes-langchain.lmChatAzureOpenAi", | |
"typeVersion": 1, | |
"position": [860, 180], | |
"id": "28754e21-86bb-4e87-871d-58784d9d7af0", | |
"name": "Azure OpenAI Chat Model", | |
"credentials": { | |
"azureOpenAiApi": { | |
"id": "REDACTED_CREDENTIAL_ID", | |
"name": "REDACTED_CREDENTIAL_NAME" | |
} | |
} | |
}, | |
{ | |
"parameters": { | |
"method": "POST", | |
"url": "=https://gitlab.com/api/v4/projects/{{ $('HTTP Request').item.json.project_id }}/merge_requests/{{ $('HTTP Request').item.json.iid }}/notes", | |
"sendHeaders": true, | |
"headerParameters": { | |
"parameters": [ | |
{ | |
"name": "PRIVATE-TOKEN", | |
"value": "REDACTED_TOKEN" | |
} | |
] | |
}, | |
"sendBody": true, | |
"bodyParameters": { | |
"parameters": [ | |
{ | |
"name": "body", | |
"value": "={{ $json.text }}" | |
} | |
] | |
}, | |
"options": {} | |
}, | |
"type": "n8n-nodes-base.httpRequest", | |
"typeVersion": 4.2, | |
"position": [1460, 0], | |
"id": "45012d4a-c27b-4fd6-af9e-19be25379146", | |
"name": "HTTP Request1" | |
}, | |
{ | |
"parameters": { | |
"model": "gpt-35-turbo", | |
"options": {} | |
}, | |
"type": "@n8n/n8n-nodes-langchain.lmChatAzureOpenAi", | |
"typeVersion": 1, | |
"position": [1440, 420], | |
"id": "d54b8cfb-8bbf-48d2-834b-0ab5585d518e", | |
"name": "Azure OpenAI Chat Model1", | |
"credentials": { | |
"azureOpenAiApi": { | |
"id": "REDACTED_CREDENTIAL_ID", | |
"name": "REDACTED_CREDENTIAL_NAME" | |
} | |
} | |
}, | |
{ | |
"parameters": { | |
"assignments": { | |
"assignments": [ | |
{ | |
"id": "ad78cd05-5796-40a1-b519-6b8d692b2688", | |
"name": "={{ $json.text }}", | |
"value": "={{ $json.chatInput }}", | |
"type": "object" | |
} | |
] | |
}, | |
"options": {} | |
}, | |
"type": "n8n-nodes-base.set", | |
"typeVersion": 3.4, | |
"position": [1120, 260], | |
"id": "34c0c210-f586-4182-870a-58dea0527c02", | |
"name": "Edit Fields1" | |
}, | |
{ | |
"parameters": { | |
"jsCode": "const raw = $input.first().json.text;\nconst parsed = JSON.parse(raw);\nreturn parsed.map(entry => ({ json: entry }));" | |
}, | |
"type": "n8n-nodes-base.code", | |
"typeVersion": 2, | |
"position": [1760, 240], | |
"id": "9e9a8c23-30b2-4546-99a7-f623b993e7ad", | |
"name": "Code" | |
}, | |
{ | |
"parameters": { | |
"method": "POST", | |
"url": "=https://gitlab.com/api/v4/projects/{{ $('GitLab Trigger').item.json.body.project.id }}/merge_requests/{{ $('GitLab Trigger').item.json.body.object_attributes.iid }}/discussions ", | |
"sendHeaders": true, | |
"headerParameters": { | |
"parameters": [ | |
{ | |
"name": "PRIVATE-TOKEN", | |
"value": "REDACTED_TOKEN" | |
} | |
] | |
}, | |
"sendBody": true, | |
"specifyBody": "json", | |
"jsonBody": "={\n \"body\": \"{{ $json.body }}\",\n \"position\": {\n \"position_type\": \"text\",\n \"base_sha\": \"{{ $json.position.base_sha }}\",\n \"start_sha\": \"{{ $json.position.start_sha }}\",\n \"head_sha\": \"{{ $json.position.head_sha }}\",\n \"new_path\": \"{{ $json.position.new_path }}\",\n \"new_line\": {{ $json.position.new_line }}\n }\n } ", | |
"options": {} | |
}, | |
"type": "n8n-nodes-base.httpRequest", | |
"typeVersion": 4.2, | |
"position": [1980, 240], | |
"id": "a1652095-3ad3-4db1-9058-e87fabfd751d", | |
"name": "HTTP Request2" | |
}, | |
{ | |
"parameters": { | |
"promptType": "define", | |
"text": "={{ $json.changes }}", | |
"messages": { | |
"messageValues": [ | |
{ | |
"message": "=You are a seasoned technical lead, mentor, and architect, ..." | |
} | |
] | |
} | |
}, | |
"type": "n8n-nodes-base.promptNode", | |
"typeVersion": 1, | |
"position": [2160, 420], | |
"id": "your-prompt-node-id", | |
"name": "Prompt" | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment