Skip to main content
RapidDev - Software Development Agency
retool-integrationsRetool Native Resource

How to Integrate Retool with GitLab

Connect Retool to GitLab by adding a GitLab Resource in Retool's Resources tab and authenticating with a personal access token or group token. Once connected, you can build an engineering operations dashboard showing merge requests, CI/CD pipeline status, open issues, and deployment triggers — giving engineering managers a unified view across all GitLab projects without switching tabs.

What you'll learn

  • How to create a GitLab Resource in Retool using a personal access token
  • How to query merge requests, CI/CD pipeline status, and open issues from the Retool query editor
  • How to build a GitLab operations dashboard with real-time pipeline status and MR review state
  • How to trigger CI/CD pipeline runs from a Retool button
  • How to combine GitLab data with other Retool data sources for cross-system engineering dashboards
Book a free consultation
4.9Clutch rating
600+Happy partners
17+Countries served
190+Team members
Intermediate16 min read20 minutesDevOpsLast updated April 2026RapidDev Engineering Team
TL;DR

Connect Retool to GitLab by adding a GitLab Resource in Retool's Resources tab and authenticating with a personal access token or group token. Once connected, you can build an engineering operations dashboard showing merge requests, CI/CD pipeline status, open issues, and deployment triggers — giving engineering managers a unified view across all GitLab projects without switching tabs.

Quick facts about this guide
FactValue
ToolGitLab
CategoryDevOps
MethodRetool Native Resource
DifficultyIntermediate
Time required20 minutes
Last updatedApril 2026

Build a GitLab Engineering Operations Dashboard in Retool

Engineering managers and DevOps leads often need a single pane of glass across their GitLab projects: which merge requests are blocked waiting for review, which pipelines are failing, which deployments are pending, and which issues are escalating. GitLab's own interface is optimized for developers working inside a single project — it is not designed for the overview perspective that ops and management roles need. Retool bridges this gap by connecting directly to GitLab's API through a native Resource, letting you build cross-project dashboards tailored to your team's workflow.

With a Retool–GitLab integration, you can surface open MRs grouped by target branch or assignee, show CI/CD pipeline health across multiple projects in a color-coded status table, trigger manual deployment jobs from a Retool button with an audit log, and correlate GitLab issue data with your project management tools or customer support platforms. Because Retool supports multiple Resources in a single app, you can combine GitLab data with Jira, PagerDuty, or your internal PostgreSQL database on the same canvas.

The GitLab native Resource in Retool covers the core GitLab REST API v4 operations with a simplified action picker, removing the need to memorize endpoint paths or manually configure headers. It works with both GitLab.com (SaaS) and self-managed GitLab instances — you provide the instance URL during resource configuration.

Integration method

Retool Native Resource

Retool includes a built-in GitLab Resource that authenticates with a personal access token or group-level token. Queries use a visual action picker to call GitLab's REST API without manually constructing endpoints — covering merge requests, pipelines, issues, commits, and deployments. All API calls are proxied server-side through Retool, so tokens never reach the browser.

Prerequisites

  • A GitLab account (GitLab.com or self-managed) with access to the projects you want to query
  • A GitLab personal access token with the 'api' scope, created at GitLab → Profile → Access Tokens (or a group access token with maintainer role for group-level operations)
  • Project IDs or namespaces for the GitLab projects you want to build queries against (found in each project's Settings → General → Project ID)
  • A Retool account with permission to create and edit Resources
  • Familiarity with Retool's query editor, Table component, and event handler system

Step-by-step guide

1

Create the GitLab Resource in Retool

Navigate to the Resources tab in Retool's left navigation. Click Add Resource in the top-right corner. In the resource type picker, locate the Development section and click GitLab. The GitLab resource configuration form opens. In the 'Resource name' field, enter a descriptive name such as 'GitLab Prod' or 'GitLab Engineering'. For self-managed instances, update the 'Base URL' field from the default 'https://gitlab.com' to your instance URL (for example, 'https://gitlab.yourcompany.com'). In the 'Personal Access Token' field, paste the token you created in GitLab. The token must have the 'api' scope to allow reading and writing across repositories, merge requests, and pipelines. If you only need read access, a token with the 'read_api' scope is sufficient and follows the principle of least privilege. Leave all other fields at their defaults. Click Save Changes. Retool will attempt a test connection by querying the GitLab API with your token. A green Connected status confirms the credentials are valid. If you manage separate GitLab instances for engineering and security teams, or separate environments (internal dev vs. external partners), create one Resource per instance. You can switch between resources in the query editor dropdown without duplicating app logic.

Pro tip: For teams that want to avoid token rotation burdens, GitLab group-level access tokens (available on GitLab Premium and above) have configurable expiration dates and can be scoped to a specific group, limiting blast radius if the token is compromised.

Expected result: The GitLab resource appears in the Resources tab with a green Connected indicator. It is now available as a data source in the Retool query editor.

2

Query merge requests and display them in a Table

Open your Retool app and navigate to the Code panel at the bottom. Click + New query. From the Resource dropdown, select your GitLab resource. The query editor presents a GitLab-specific action picker. From the 'Action' dropdown, select 'List Merge Requests'. Retool exposes input fields for the query parameters: - 'Project ID': Enter the numeric project ID (e.g., 12345678) or leave blank and use the 'Group ID' field to query all projects in a group. - 'State': Set to 'opened' to show only active MRs. Other options are 'closed', 'locked', and 'merged'. - 'Target branch': Optionally filter to 'main' or 'production' if you want to focus on release-critical MRs. - 'Per page': Set to 50 or 100 to retrieve more results per call. Name the query 'getMergeRequests'. Leave 'Run query on page load' set to On so the data loads automatically. Switch to the Canvas view. Drag a Table component from the Component panel onto the canvas. In the Table's Data property, enter `{{ getMergeRequests.data }}`. The Table will auto-generate columns from the response. In the Column settings, choose to show: title, author.name, target_branch, state, web_url (as a hyperlink), created_at, and detailed_merge_status. Use the Column display settings to rename them with user-friendly headers. Add a mapped column 'Pipeline Status' bound to `{{ row.head_pipeline?.status || 'none' }}` with conditional coloring: green for 'success', red for 'failed', yellow for 'running'.

transformer.js
1// Transformer: reshape merge request data for display
2const mrs = data;
3return mrs.map(mr => ({
4 id: mr.iid,
5 title: mr.title,
6 author: mr.author?.name || 'Unknown',
7 target_branch: mr.target_branch,
8 status: mr.detailed_merge_status,
9 pipeline: mr.head_pipeline?.status || 'none',
10 created: new Date(mr.created_at).toLocaleDateString(),
11 url: mr.web_url,
12 reviewers: (mr.reviewers || []).map(r => r.username).join(', ')
13}));

Pro tip: GitLab's merge request list API returns a maximum of 100 items per page. If your team has more than 100 open MRs, add a pagination component or add a filter Select component for 'my_review_requests' to scope the list to the current user's review queue.

Expected result: The Table component populates with open merge requests from the configured GitLab project or group. Each row shows title, author, target branch, pipeline status, and a link to the MR in GitLab.

3

Build a CI/CD pipeline status panel

With merge requests displayed, add a pipeline monitoring section to give operators visibility into build health. Create a new query: click + New query, select your GitLab resource, and from the 'Action' dropdown choose 'List Pipelines'. Set 'Project ID' to `{{ projectSelect.value }}` so operators can switch between projects using a dropdown. Set 'Per page' to 20 and 'Order by' to 'updated_at' and 'Sort' to 'desc' so the most recent pipelines appear first. Name the query 'getPipelines'. On the canvas, add a Select component named 'projectSelect'. Populate its Options manually with project IDs and display names for your key repositories, or bind it to a separate GitLab 'List Projects in Group' query that returns all projects in your namespace. Drag a second Table component below the MR table. Set its Data to `{{ getPipelines.data }}`. Configure columns for: id, status (with color badges), ref (branch name), sha (shortened to first 8 chars via a column transformer: `{{ row.sha?.substring(0,8) }}`), created_at, duration (formatted as seconds), and a direct link to the pipeline. Add a Button component labeled 'Retry Pipeline'. In its Event Handler, wire it to a new query: Action = 'Retry Pipeline', Project ID = `{{ projectSelect.value }}`, Pipeline ID = `{{ pipelineTable.selectedRow.id }}`. This lets operators retry failed pipelines without leaving Retool. Add a second Button labeled 'Cancel Pipeline' wired to an 'Cancel Pipeline' action query — useful for stopping runaway builds that are consuming CI minutes.

transformer.js
1// Transformer: summarize pipeline stats for a Chart component
2const pipelines = data;
3const counts = pipelines.reduce((acc, p) => {
4 acc[p.status] = (acc[p.status] || 0) + 1;
5 return acc;
6}, {});
7return Object.entries(counts).map(([status, count]) => ({ status, count }));

Pro tip: Bind the 'Retry Pipeline' button's Disabled property to `{{ pipelineTable.selectedRow?.status !== 'failed' }}` so the button is only active when a failed pipeline is selected. This prevents accidental retries of running or successful pipelines.

Expected result: A second Table shows recent pipeline runs for the selected project with color-coded status badges. The Retry and Cancel buttons are active when a relevant pipeline row is selected.

4

Add issue tracking and cross-project search

Engineering managers often need to track GitLab issues alongside code changes. Create a new query: select your GitLab resource, Action = 'List Issues', and set parameters: - 'Scope': 'all' to include all group issues. - 'State': `{{ issueStateSelect.value }}` to allow filtering opened/closed. - 'Labels': `{{ labelsInput.value }}` so operators can filter by label (e.g., 'priority::high' or 'backend'). - 'Assignee username': `{{ assigneeInput.value }}` for per-person views. Name the query 'getIssues'. On the canvas, add a third section labeled 'Issues' with: - A Select component 'issueStateSelect' with options 'opened' and 'closed'. - A Text Input 'labelsInput' for label filtering. - A Text Input 'assigneeInput' for assignee filtering. - A Table component bound to `{{ getIssues.data }}` showing title, project (from references.full), assignees, labels, due_date, and a web_url link. For cross-project issue search, set 'Group ID' instead of 'Project ID' in the getIssues query — GitLab's API supports group-level issue listing that aggregates across all sub-groups and projects. Add a 'Create Issue' form using Retool's Form component. Configure a GitLab 'Create Issue' query bound to the form fields (project dropdown, title input, description text area, labels input). Wire the form's Submit button to the create query, with the getIssues query triggered on success to refresh the list.

transformer.js
1// Transformer: extract unique assignees from issues list for a filter dropdown
2const issues = data;
3const assignees = new Set();
4issues.forEach(issue => {
5 (issue.assignees || []).forEach(a => assignees.add(a.username));
6});
7return Array.from(assignees).sort().map(u => ({ label: u, value: u }));

Pro tip: Use Retool's built-in date range picker component with the GitLab 'created_after' and 'created_before' parameters to scope issue and MR queries to a specific sprint window. This makes sprint retrospective views much easier to prepare.

Expected result: A searchable issues table appears with label and assignee filters. Selecting different states switches between open and closed issues. The Create Issue form submits new issues to the selected project and refreshes the table.

5

Trigger deployments with a gated approval workflow

One of the most powerful Retool–GitLab integrations is adding governance to manual deployment jobs. GitLab CI/CD allows pipeline jobs to be marked as 'manual' — they pause until a human explicitly triggers them. Retool can surface these pending manual jobs and add an approval layer before triggering. Create a query: Action = 'List Pipeline Jobs', Project ID = `{{ projectSelect.value }}`, Pipeline ID = `{{ pipelineTable.selectedRow.id }}`. Name it 'getPipelineJobs'. Filter for manual jobs using a Transformer: `return data.filter(job => job.status === 'manual');` Display this in a Table component 'jobsTable' showing job name, stage, status, and environment. Add a 'Trigger Job' button. In its Event Handler, set the action to trigger a new GitLab query: - Action: 'Play Job (Trigger Manual Job)' - Project ID: `{{ projectSelect.value }}` - Job ID: `{{ jobsTable.selectedRow.id }}` Before wiring this directly, add a Confirmation Modal: enable 'Show confirmation before running' in the button's event handler and set the confirmation message to: 'Are you sure you want to trigger job {{ jobsTable.selectedRow.name }} in {{ jobsTable.selectedRow.environment }}? This will deploy to production.' Add an on-success handler that writes an audit log to Retool Database or PostgreSQL: `{ triggered_by: current_user.email, job_id: jobsTable.selectedRow.id, job_name: jobsTable.selectedRow.name, triggered_at: new Date().toISOString() }` For complex multi-stage deployment workflows involving multiple GitLab projects and Slack notifications, RapidDev's team can help design a Retool Workflow that orchestrates GitLab triggers with approval gates and status notifications.

transformer.js
1// Transformer: filter pipeline jobs to show only manual/playable jobs
2const jobs = data;
3return jobs
4 .filter(job => job.status === 'manual')
5 .map(job => ({
6 id: job.id,
7 name: job.name,
8 stage: job.stage,
9 status: job.status,
10 environment: job.environment?.name || 'N/A',
11 created_at: new Date(job.created_at).toLocaleString()
12 }));

Pro tip: Protect the deployment trigger button with Retool group-based permissions. Add a condition `{{ current_user.groups.includes('deploy-approvers') }}` to the button's visibility property so only authorized users can see and interact with deployment controls.

Expected result: The jobs table shows only manual pipeline jobs for the selected pipeline. The Trigger Job button shows a confirmation dialog before executing. Successful triggers write an audit log entry and the jobs table refreshes to show the job status changing to 'running'.

Common use cases

Build a cross-project merge request review dashboard

Create a Retool app that lists all open merge requests across your GitLab groups, showing author, target branch, reviewer, approval status, and pipeline state. Engineering managers can filter by project, reviewer, or age, and see at a glance which MRs are blocked waiting for review versus which are ready to merge. A one-click 'Merge' button can trigger the merge operation for fully approved MRs directly from the dashboard.

Retool Prompt

Build a Retool dashboard with a Table showing all open merge requests across selected GitLab projects, with columns for title, author, target branch, approval status, pipeline status, and created_at. Add filters for project and reviewer, and a Merge button that triggers the merge action for the selected row.

Copy this prompt to try it in Retool

Monitor CI/CD pipeline health with status indicators and retry controls

Build a Retool pipeline monitoring panel that polls GitLab for recent pipeline runs across all projects, displays pass/fail/pending status with color-coded badges, and shows average run duration. Ops engineers can identify consistently failing stages, retry failed pipelines with a button click, and see who triggered each run — without navigating into each project individually.

Retool Prompt

Build a Retool pipeline status panel with a Table of recent pipelines across all projects, color-coded status badges (success=green, failed=red, running=yellow), a Retry Pipeline button for failed runs, and a Chart showing pipeline success rate over the last 30 days.

Copy this prompt to try it in Retool

Trigger manual deployment jobs from a gated Retool workflow

Build a deployment control panel in Retool that lists pending deployment jobs tagged as manual in GitLab CI/CD pipelines. Operations teams can review the job details, confirm the target environment, and click Play to trigger the deployment — with a Retool confirmation modal, audit log entry, and Slack notification on completion. This adds governance and an audit trail to GitLab's native manual job triggers.

Retool Prompt

Build a Retool deployment control panel showing manual pipeline jobs pending in production, with a Play button that triggers the selected job, a confirmation modal asking the operator to confirm the environment, and a log table recording who deployed what and when.

Copy this prompt to try it in Retool

Troubleshooting

Resource test fails with 'API token is missing or incorrect' or HTTP 401 Unauthorized

Cause: The personal access token is invalid, has been revoked, expired, or was created without the required 'api' scope. GitLab tokens with only 'read_repository' scope cannot access merge requests or pipeline data.

Solution: Go to GitLab → Profile → Access Tokens and verify the token exists and has not expired. Check that it has the 'api' scope (or at minimum 'read_api' for read-only operations). If the token is expired or missing, generate a new one, copy it immediately (it is shown only once), and update the Retool resource. For self-managed instances, also confirm the GitLab instance URL in the resource matches exactly — a trailing slash or http vs https mismatch will cause authentication failures.

GitLab queries return empty arrays even though the project has data

Cause: The token belongs to a user who does not have access to the specific project, or the Project ID/Group ID in the query is incorrect. GitLab's API silently returns empty results rather than an error when a token lacks permissions for a resource.

Solution: Verify the numeric Project ID in GitLab under the project's Settings → General page. Confirm the token owner has at least Reporter access (not just Guest) to the project. For group-level queries, confirm the Group ID is correct and the token has access to the group. If using a group token instead of a personal token, ensure it was created with at minimum 'Reporter' role.

Pipeline trigger query returns 'Insufficient permissions to trigger manual job'

Cause: Triggering manual CI/CD jobs requires Developer role or higher in GitLab. The personal access token used in the Resource belongs to a user with Reporter or Guest role on the project.

Solution: In GitLab, navigate to the project → Settings → Members and confirm the token owner has Developer or Maintainer role. If they have only Reporter access, ask the project owner to upgrade their role. As an alternative, create a dedicated 'retool-bot' GitLab user with Developer role on the relevant projects and use that user's token in Retool — this separates automation tokens from individual user credentials and makes permission management cleaner.

The 'List Merge Requests' query only returns 20 results even though there are more open MRs

Cause: GitLab's API defaults to returning 20 items per page. Retool's native GitLab connector passes this default unless explicitly overridden with a higher per_page value.

Solution: In the query configuration, set the 'Per page' parameter to 100 (GitLab's maximum). If you have more than 100 open MRs, implement pagination in Retool using a Number Input component bound to a page parameter in the query, or use a Retool Workflow to paginate through all results and store them in a temporary state variable for display.

Best practices

  • Create a dedicated 'retool-bot' GitLab service account with the minimum required role (Developer for pipeline triggers, Reporter for read-only dashboards) and use its token in Retool rather than a personal developer's token — this avoids dashboard breakage when individuals leave the team.
  • Store the GitLab personal access token in Retool Settings → Configuration Variables marked as secret, then reference it in the resource configuration. This prevents the token from being visible to non-admin Retool users in the resource settings panel.
  • Use Retool's resource environments (production, staging, development) to maintain separate GitLab Resources pointing to different projects or instances — prevent operators from accidentally triggering production deployments from a staging dashboard.
  • Add confirmation modals to all write operations (merging MRs, triggering pipelines, creating issues) using Retool's built-in 'Show confirmation before running' event handler option. Deployment actions should include the target environment name in the confirmation message.
  • Cache read-heavy GitLab queries (MR lists, pipeline history) using Retool's query cache setting to reduce API call frequency — GitLab's REST API rate limit is 2,000 requests per minute for authenticated users, but heavy polling from multiple Retool users can approach this limit quickly.
  • Combine the GitLab resource with your team's Jira or Linear resource in the same Retool app to create a unified engineering operations view. Use JavaScript transformers to join GitLab issue IDs with Jira ticket references for cross-system traceability.
  • Set up Retool Workflows with webhook triggers to receive GitLab webhooks (push events, MR state changes, pipeline completions) and update a Retool Database table that your dashboard queries — this gives near-real-time updates without polling.
  • Use GitLab's group-level tokens for resources that span multiple projects, and project-level tokens for resources that should only access a single repository — this enforces the principle of least privilege at the GitLab level.

Alternatives

Frequently asked questions

Does Retool's GitLab Resource work with self-managed GitLab instances?

Yes. When creating the GitLab Resource in Retool, update the 'Base URL' field from 'https://gitlab.com' to your self-managed instance URL (e.g., 'https://gitlab.yourcompany.com'). The resource uses the same GitLab REST API v4 that is present in all self-managed installations. Ensure your Retool instance (Cloud or self-hosted) can reach the GitLab server over HTTPS — you may need to whitelist Retool's IP ranges in your firewall for Cloud deployments.

Can Retool receive GitLab webhook events to update a dashboard in real time?

Retool does not natively receive webhooks in apps. However, you can configure a Retool Workflow with a Webhook trigger — GitLab sends pipeline or MR events to the workflow's unique URL, the workflow processes the payload, writes state to Retool Database, and your app queries Retool Database on a short interval. This creates a near-real-time dashboard without direct webhook support in the app layer.

What GitLab API operations does Retool's native connector support?

Retool's native GitLab connector covers the most common operations: listing and getting merge requests, listing and triggering pipelines, listing and playing manual jobs, listing issues, creating issues, listing commits, listing branches, and listing projects and groups. For operations not covered by the native action picker (such as creating deployment environments or managing GitLab Pages), you can fall back to using a generic REST API Resource targeting GitLab's v4 API endpoints with your token in the Authorization header.

How do I show merge request approval status in a Retool Table?

GitLab's standard 'List Merge Requests' API response includes a 'detailed_merge_status' field that reflects the approval state (e.g., 'approved', 'not_approved', 'blocked_by_other_mrs'). Map this field as a Table column with conditional coloring. For the full approvals detail (who approved and who is required), use a separate 'Get Merge Request Approvals' query triggered on row selection, and display results in a detail panel to the right of the Table.

Can I use Retool to close or merge GitLab merge requests in bulk?

Yes, but GitLab's API processes one merge request per request — there is no bulk merge endpoint. You can implement bulk operations in Retool using a JavaScript query that iterates over Table's selectedRows and calls the GitLab 'Merge MR' action for each one in sequence using a loop. Use Promise.all for concurrent requests, but be mindful of GitLab's rate limits; parallel requests to merge many MRs simultaneously can trigger 429 errors.

RapidDev

Talk to an Expert

Our team has built 600+ apps. Get personalized help with your project.

Book a free consultation

Integrations are where projects stall

We wire Retool integrations like this one every week — auth, webhooks, edge cases included. Fixed-price builds from $13K, delivered in 6–10 weeks.

Talk to an integration engineer

We put the rapid in RapidDev

Need a dedicated strategic tech and growth partner? Discover what RapidDev can do for your business! Book a call with our team to schedule a free, no-obligation consultation. We'll discuss your project and provide a custom quote at no cost.