AI request flow: trace a route through the code as a sequence diagram

Pick a route found in a repository's code, such as POST /orders, and have AI trace it step by step through the handler, services and database as a Mermaid sequence diagram. Plans, cost, supported hosts and frameworks, and what the result leaves out.

Diagrams from repositories · Updated November 28, 2026 · 7 min read

A route map tells you which function handles POST /orders. It doesn't tell you what happens next: which service the handler calls, which tables it writes, what goes on a queue, and what comes back. The AI request flow follows one request through a repository's code and draws it as a sequence diagram: who calls whom, in order, with each step numbered. You choose the route from the routes Flowgraph Studio finds in the code, or let the AI pick the main request.

Plan: Pro and Pro Max. Each request flow uses 5 AI credits, or none when the same one was already made. Pro includes 100 AI credits a month and Pro Max 300 (see AI credits).

Hosts: public repositories on GitHub, GitLab, Bitbucket and Azure DevOps, and private ones after you agree for each (see Private repositories).

It is the second kind of AI overview. The first, the AI architecture overview, draws the whole system's parts; a request flow draws one request's path through them.

Make a request flow

  1. In Projects, choose Import repository, paste the repository's address, and choose Scan repository. For a large repository, paste one folder's address (see the guides for GitHub, GitLab, Bitbucket and Azure DevOps).
  2. In the scan result, find AI request flow. It says "It traces the main request, chosen by the AI." To trace a route of your own, choose Choose a route (below).
  3. Choose Make request flow. Flowgraph reads the code and asks the AI. This can take a minute.
  4. The request flow joins the list of diagrams to add, ticked. Add it and open it like any other diagram.

The AI rows in the scan result: AI architecture overview with Make overview, and AI request flow with Make request flow and, under Trace, the route POST /owners/{ownerId}/pets/{petId}/visits/new chosen

Pick a route

Choose a route appears under the request flow when the scan offers a Route map, that is, when the code uses a web framework or command-line library the route map reads:

Language Frameworks
TypeScript and JavaScript Express, Hono, Fastify, Koa, NestJS, Next.js (app and pages routers, with API routes), Remix routes, Commander, Cloudflare Workers' scheduled and queue handlers
Python FastAPI, Flask, Django (urls.py), Click, Typer
Java Spring, JAX-RS
Go net/http's ServeMux, Gin, Echo, chi
C# ASP.NET Core controllers and minimal APIs

Choosing it reads and parses the code in your browser, the same read the code diagrams use ("Finding the routes in the code…"). A list called Trace then shows each route with its handler, such as GET /orders · list(), and The main request (the AI chooses) at the top. Pick one, then choose Make request flow.

The AI then reads that route's handler first, the file that declares the route, and what the handler imports, those in its own folder first. It is told the route and its handler, and traces that request from where it comes in.

If no routes are found, the row says so, and the request flow traces the main request. Routes the route map can't find, such as those made in a loop when the code runs, aren't in the list either. If the code couldn't be read, the row says "The code couldn't be read to find its routes. Try again."

Without a route

Every repository can have a request flow, in any language. Without a chosen route, the AI picks the one request that best shows how the system works: what its users do most, such as placing an order or signing in. For a library or a command-line tool, it traces the main call or command. The diagram's title and summary say which request it traced, such as "How a new pet visit is saved".

When the code is in TypeScript, JavaScript, Python, Java, Go or C#, your browser also sends the names of the imports between files and the routes it found (never the code), and Flowgraph reads the routes' handlers first when there are any. Otherwise, files are chosen by name: routes, handlers and controllers, and where programs start.

What the result shows

An AI request flow of saving a pet visit in Spring PetClinic: the browser posts to VisitController, which loads the pet from PetRepository, binds and validates the visit, saves it through VisitRepository into the database, and redirects back, in nine numbered steps

  • Participants, left to right in the order the request first reaches them: the client, the entry point (a route, handler or command), the modules and services that do the work, the databases, caches and queues they use, and outside services. A user-facing client is drawn as a person.
  • Messages, in order and numbered: a solid arrow for a call that waits for its answer, a dashed arrow for the answer, and an open arrow for something sent without waiting, such as a queue message, an event or a background job. Each is labelled with what happens, such as insert order or 200 order id.
  • A title and a summary of what happens, kept as the diagram's description.

A request flow has at most 10 participants and 30 messages. It is an ordinary Mermaid sequence diagram, so you can edit, style, export and share it like any other.

Check what it left out

A request flow is approximate. It shows one path through the code, as far as the files read show it:

  • Only what the files show. A step the files only suggest is inferred, and the AI says so in its note. Steps that "usually" happen aren't added.
  • One path. There are no branches, loops or error paths: the diagram is the request as it usually goes. Repetition and logging are left out.
  • Only the files read. At most 80 files are read, the start of each source file, so a repository's own helpers deeper in the code may be missing or merged into their caller.

Open the diagram and choose From GitHub in the editor's top bar (or From GitLab, From Bitbucket, From Azure DevOps). The panel shows the AI's note on what it couldn't see or had to infer, and each participant with its part in the request and the files it was read from, linked to the host at that commit.

The From GitLab panel of a request flow: the repository, branch and commit, a note that PetRepository's source wasn't read and the insert into the visits table was inferred, and each participant with the files it was read from, with Regenerate and Done

The route map, call maps and request flow

These three come from the same scan and work well together. The route map and call maps are drawn from the code with no AI, and the same commit always gives the same diagram; the request flow is written by AI. All are described in Draw a GitHub repository's architecture.

Route map Call map AI request flow
Shows Every route, page and command, and the function that handles it Which function calls which, in a folder or one file One request's path across files, services and databases
Made by The parser, no AI The parser, no AI; calls are matched by name, so it is approximate Claude, from a digest of the code
Plan and cost Every plan, free Every plan, free Pro and Pro Max, 5 AI credits

A good order: draw the route map to see the routes, make a request flow of the one you care about, then draw a call map or a function flowchart of its handler to check the steps against the code.

Cost, caching and Regenerate

A request flow uses 5 AI credits, the same as an architecture overview. For a public repository it is kept for 30 days and shared: the next person to make a request flow of the same commit and folder, tracing the same route, gets it at once, and it isn't charged. Private repositories' request flows are never cached or shared, and always use their credits. If one fails on our side, its credits are given back.

Regenerate, in the From GitHub panel, makes a new request flow from the branch's latest commit as a new diagram beside the earlier one, and always uses 5 AI credits. It traces the main request: to trace a chosen route again, import the repository again and choose it under Trace.

When it fails

  • "The AI couldn't find a request to trace." Scan the folder that holds the application.
  • "The request flow was too large to finish." Scan one folder of the repository.
  • "That route isn't in the code read for this commit. Choose it again from the list." The route wasn't found in the commit Flowgraph read, for example when the branch moved on after the scan. Scan the repository again and choose the route from the new list.

Other messages, such as the host limiting reads or not having enough credits, are the same as for the architecture overview: see Limits, and when it fails.

For a private repository, the first request flow asks you to agree that excerpts of its code may be sent to Anthropic, our AI provider, with Agree and make request flow or Not now. Files that hold credentials are left out and values that look like secrets are replaced, for every repository.

More guides