Draw a GitLab project's architecture from its own files
Turn a GitLab project's Compose files, Kubernetes manifests, Terraform, OpenAPI descriptions, .gitlab-ci.yml, SQL migrations and workspace packages into editable diagrams, including private projects and projects in subgroups.
Flowgraph Studio reads the files that already describe a system (Docker Compose, Kubernetes manifests, Terraform, OpenAPI descriptions, the CI configuration, SQL migrations, workspace packages) and draws each one as a diagram you can edit. This guide covers what is particular to GitLab.com. The diagrams themselves are the same for every host, and Draw a GitHub repository's architecture describes each one in detail.
Import a public project
Open Flowgraph Studio, choose Import repository, paste the project's address and choose Scan repository. Any of these work:
gitlab.com/group/projectgitlab.com/group/subgroup/project, with as many subgroups as the project hasgit@gitlab.com:group/project.git, the SSH address you clone with
For a large project, scan one folder: open the folder on GitLab and paste that address, which has the form gitlab.com/group/project/-/tree/branch/folder. Branch names that contain a slash, such as feature/login, work too. An address that points at a file (/-/blob/…) scans the folder the file is in.
Your browser reads a public project straight from GitLab, with no sign-in. GitLab allows 500 such reads a minute from one network, which is plenty for a scan.
Scanning needs no account. Adding the diagrams, and refreshing them later, needs one: Free accounts can add diagrams from 3 repositories in all and refresh them 50 times a month, and Pro and Pro Max have no limit. Delete every diagram from a repository to free its place for another, once a month.
What the scan finds
The scan lists each diagram it can draw, for example:
- Services from
docker-compose.yml - Kubernetes from the manifests in
k8s/ - Infrastructure from the Terraform in
infra/ - Endpoints from
openapi.yaml - GitLab CI pipeline from
.gitlab-ci.yml - Data model from the SQL migrations, a schema dump or a Prisma schema
- Package map of the workspace packages
- Mermaid diagrams already written in the README and documentation
- Under From the code, a Codebase map of the folders and, for TypeScript, JavaScript, Python, Java, Go and C#, the Module dependencies and Class diagrams, and a Route map when the code uses a web framework it knows, drawn from the code when you choose Draw (what it shows).
Tick the ones you want. They go into a new project named after the GitLab project.
The GitLab CI pipeline
The pipeline is drawn from .gitlab-ci.yml, as GitLab runs it:
- Each stage is a group, in the order the stages run, with an arrow from one stage to the next.
- A job with
needs:gets arrows from the jobs it needs instead, since it can start before its stage would. extends:is followed through hidden templates (jobs whose names start with a dot) and other jobs, so a job shows the image and settings it inherits.- Files pulled in with
include: localare read too. Includes from other projects, CI templates or URLs aren't, and the scan says so. - Manual jobs and jobs that deploy to an environment are marked, so the step to production stands out.
Private projects (Pro and Pro Max)
Connect GitLab under Account → GitLab, Bitbucket, and Azure DevOps, or from the GitLab tab under Your repositories in the import dialog. GitLab asks you to authorize Flowgraph Studio with one permission, read_api: it can list your projects and read their files, and can't change anything.
Your projects then appear on the GitLab tab, the most recently active first. Only projects where you're at least a Reporter are listed, because a Guest can't read a private project's code. Pick one, or paste its address as you would a public one.
A private project is read by Flowgraph's server with your own connection, and handed straight to your browser to draw. GitLab checks on every read that you can still read the project. Its files are never stored, cached or logged. Before diagrams from a private project are added, you choose their titles and the project's name, because those are what people see if you share them.
Disconnect under Account withdraws Flowgraph's access at GitLab and deletes its tokens. You can also revoke it on GitLab, under your profile's Applications. Account shows what Flowgraph read in the last 90 days: which project and commit, and how many files.
AI overviews (Pro and Pro Max)
In the scan result, Make overview has AI read the code and draw what the system is made of and how the parts connect. Make request flow follows its main request step by step as a sequence diagram. Each uses 5 AI credits, and an overview someone already made of the same public commit costs nothing. See AI architecture overview of a repository and AI request flow: trace a route through the code.
For a private project, the first overview asks you to agree that excerpts of its code may be sent to Anthropic, our AI provider. Your answer is remembered for that project, and you can withdraw it under Account. Private overviews are never cached or shared with anyone else. For every project, files that hold credentials are left out, and values that look like secrets are replaced before anything is sent.
Link to it from your README
A link such as https://flowgraph.studio/gitlab/group/project opens the import with the project filled in; add /-/tree/branch/folder for one folder. The scan result has an Open in Flowgraph badge to copy into the README:
[](https://flowgraph.studio/gitlab/group/project)
Keep it up to date
Open a diagram, choose From GitLab in the editor's top bar, then Refresh from GitLab. Flowgraph reads the latest commit of the same branch, draws the diagram again from the same files, and shows what changed side by side. Replace the diagram, with the earlier one kept in version history, or add the new drawing beside it. Refreshing is free. From GitLab also lists the files each diagram came from, linked to GitLab at that commit.
Only GitLab.com is supported for now. Projects on a GitLab server your company runs itself can't be imported yet.
See also Bitbucket, Azure DevOps and Keep architecture diagrams up to date.
More guides
- Edit Mermaid diagrams visually in VS CodeDrag, connect and restyle a Mermaid diagram on Flowgraph's canvas inside VS Code, and every change is written back into the .mmd file or Markdown block as ordinary code.
- Keep a diagram's style in its code with %% flowgraph-themeOne comment line keeps a Mermaid diagram's Flowgraph theme in the file, so it looks the same in your repository, in VS Code, from the CLI and through the render API.
- Preview Flowgraph diagrams in VS Code, with icons, layout and your themeInstall the Flowgraph Studio extension to preview Mermaid files and Markdown blocks in VS Code as Flowgraph draws them, see mistakes in plain words, and export SVG or PNG.