# Flowgraph Studio guides > Flowgraph Studio is an editor for Mermaid diagrams: write Mermaid or edit on the canvas, with themes and 15,000+ AWS, Azure, Google Cloud and Kubernetes icons, and draw diagrams from a Git repository's code and configuration. It also makes LinkedIn explainers, whiteboards and design documents. # Edit Mermaid diagrams visually in VS Code Source: https://flowgraph.studio/guides/edit-diagrams-visually-in-vs-code/ Updated: 2026-12-04 Drag, 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. The [Flowgraph Studio extension](/guides/vs-code-extension/) can open a diagram on the same canvas the website uses, inside VS Code. You drag nodes, connect them and pick a theme there, and the extension writes each change into your file as an ordinary edit. There's no second copy anywhere: the file in your repository is the diagram, so VS Code's Undo, Save, the unsaved dot and git all work as they do when you type. **Plan:** Free, Pro and Pro Max. The visual editor is free. Signed in on Pro or Pro Max, the Pro icon sets (such as the Gen AI icons) draw in it and are unlocked in its icon picker. ## Open the visual editor For a `.mmd` or `.mermaid` file, use any of these: - **Edit Visually** in the editor's title bar (the layout icon). - **Edit Visually** in the line of links at the top of the file. - **Flowgraph: Edit Visually** from the command palette. It opens beside the text editor, so you see the code and the canvas together. Typing in the text editor redraws the canvas, and changes on the canvas appear in the text straight away. ![A Mermaid file in VS Code on the left, and Flowgraph's visual editor on the right with the Orders API node selected and moved; the file's last line now holds the saved positions](/guide-images/vscode-edit-visually.webp) To always open `.mmd` files on the canvas, right-click one in the Explorer, choose **Open With…**, then **Configure default editor for '*.mmd'…** and pick **Flowgraph Visual Editor**. The text editor is the default until you do. ## What you can do on the canvas - **Move and resize:** drag a node, or drag the handles of a selected one. Drag on empty canvas to select several. - **Connect:** select a node and drag one of its **+** handles onto another node. Click a **+** instead to add a new node connected on that side. - **Add:** **Node**, **Icon node** (the icon picker, with the cloud, brand and Lucide sets), and **Text** in the toolbar. - **Change a node:** select it and edit its label, subtitle, status and shape in the bar above the canvas. - **Auto layout:** clear the saved positions and let Flowgraph lay the diagram out again. - **Style:** the panel on the right has the website's themes, colours, fonts and layout settings. Delete removes the selection; Escape clears it. ## How changes reach the file Everything you do becomes normal Mermaid code in the file: - **Positions** go into a `%% flowgraph-layout:` comment line at the end, the same line the website writes. The first drag adds it; later ones update it. - **A style** you pick goes into a `%% flowgraph-theme:` line just above it. If your repository's `flowgraph.yml` already gives the file that style, no line is added. See [Keep a diagram's style in its code](/guides/keep-diagram-style-in-code/). - **New nodes and connections** are written as Mermaid statements. ![The visual editor after choosing Forest Canopy: the canvas is drawn in Forest Canopy, and the file has a flowgraph-theme line above its layout line](/guide-images/vscode-edit-style.webp) Because each change is an edit of the file: - **Undo** (`Ctrl+Z`, `Cmd+Z` on a Mac) takes back the last change, from either side. - **Save** works as usual, and the tab shows the unsaved dot until you do. - **Git** shows only the lines that changed. A drag changes the layout line; a new theme changes the theme line. - Opening a file on the canvas doesn't change it. Flowgraph fixes each node's position in the code with your first change, not before. Other Mermaid tools ignore `%%` comment lines, so the file still draws everywhere else, in their own layout and style. ## Edit a diagram inside a Markdown file Each ```` ```mermaid ```` block in a Markdown file has **Edit Visually** in the line of links above it. The canvas opens on that block alone, beside the file. Changes replace only the block's lines, indented like its fence, and the rest of the file is never touched. ![A README in VS Code with a Mermaid block of rich nodes, and the visual editor beside it on that block; a node was dragged, and the block now ends with its layout line](/guide-images/vscode-edit-markdown-block.webp) If you change the block in the text while the canvas is open, the canvas redraws from your text. ## What stays on the website Some things need your Flowgraph Studio account and are on flowgraph.studio only: comments and reviews, version history (git does that job for files), share links, your saved presets and snippets, and AI help. Use **Open on flowgraph.studio** in the line of links when you need them. --- # Keep a diagram's style in its code with %% flowgraph-theme Source: https://flowgraph.studio/guides/keep-diagram-style-in-code/ Updated: 2026-12-04 One 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. A diagram you styled in Flowgraph Studio and committed to a repository used to lose its look on the way: the code went into the file, and the theme stayed behind on the website. Now the style travels inside the code, as one comment line. Every place Flowgraph draws the file reads it: the VS Code extension, the CLI, the render API, and the website when you import the file again. Other Mermaid tools skip it, as they skip any `%%` comment. **Plan:** Free, Pro and Pro Max. ## What the line looks like ```text flowchart LR web[Web app] --> api[Orders API] api --> db[(Orders DB)] %% flowgraph-theme: {"v":1,"presetId":"midnight","colors":{"accentColor":"#2DD4BF"}} %% flowgraph-layout: {"v":1,"nodes":{"web":{"x":40,"y":60}}} ``` - `presetId` is the preset the style starts from: Midnight, Glass, Blueprint CAD and the rest (the list is below). - Everything else is only what you changed from that preset, so a plain preset stays short: `{"v":1,"presetId":"glass"}`. - `v` is the line's own version. Leave it as `1`. - It sits just above the `%% flowgraph-layout:` line, which keeps the positions you arranged by hand. Both are optional, and each works without the other. ## Get the line into a file You rarely need to write it by hand: - **From the website:** open the diagram, choose **Export → Mermaid code**, and keep **Style, positions and story** on **Keep them**. The `.mmd` or `.md` file you download carries the line. - **From VS Code:** with the [Flowgraph Studio extension](/guides/vs-code-extension/), **Pull** and **Save into Workspace** write the saved diagram's style into the file. If your repository's `flowgraph.yml` already gives files that style, no line is added, so the files stay plain. - **By hand:** add the line at the end of the diagram, as in the examples below. ## Where it's read | Where | What happens | | --- | --- | | VS Code preview and VS Code's Markdown preview | The diagram is drawn, and its background painted, in the line's style, ahead of the repository's `flowgraph.yml` and the `flowgraph.theme` setting. Exports from the preview use it too. | | [Render API](/guides/mermaid-render-api/) and the CLI | `/v1/render`, `flowgraph render` and `flowgraph sync` draw the diagram in the line's style. | | Importing into Flowgraph Studio | Opening the file, pasting the code, a repository import and **Open on flowgraph.studio** all give the new diagram the line's style. The line then leaves the code: on the website the style is kept beside the code, where the Style panel edits it. | | Typing or pasting into the code panel | The same: once the line is complete, it becomes the diagram's style and leaves the code. | | The API and AI assistants | Code sent to `POST` or `PUT /v1/diagrams`, or through the MCP server, saves the line as the diagram's style. | ## Which style wins When a file has a theme line, that's its style. A style from anywhere else is only the default for files without one: 1. The diagram's own `%% flowgraph-theme:` line. 2. The `theme:` file named in the repository's `flowgraph.yml` (see [Keep README diagrams up to date in CI](/guides/keep-readme-diagrams-up-to-date-in-ci/)). 3. In VS Code, the `flowgraph.theme` setting. 4. Glass. The render API's `theme` field and the CLI's `--theme` flag follow the same rule: they style code that doesn't bring its own. So a repository can give all its diagrams one look through `flowgraph.yml`, and a single diagram that needs its own (a slide, a dark poster) carries a line. ## Write one by hand Start with a preset and add what you want to change: | Key | Values | | --- | --- | | `presetId` | `midnight`, `monochrome`, `glass`, `cyberpunk-neon`, `warm-editorial`, `blueprint-cad`, `forest-canopy`, `ember-workshop`, `print-ready`, `slide-deck`, `sage-notebook` | | `colors` | Any of `nodeFillTop`, `nodeFillBottom`, `nodeBorder`, `nodeText`, `edgeColor`, `canvasBg`, `accentColor`, `clusterBg`, `clusterBorder`, `shadowColor`, as `#RRGGBB`, `rgb()` or `hsl()` | | `fontFamily` | `Inter`, `Plus Jakarta Sans`, `Space Grotesk`, `IBM Plex Sans`, `Source Sans 3`, `Nunito`, `Roboto Slab`, `Merriweather`, `Lora`, `JetBrains Mono`, `Fira Code`, `Caveat` | | `curveStyle` | `basis`, `bumpX`, `monotoneX`, `stepAfter`, `linear` | | `lookMode` | `classic`, `handDrawn` | | `direction` | `default`, `TB`, `LR`, `BT`, `RL` | | `layoutEngine` | `elk`, `elk.stress`, `elk.mrtree`, `elk.radial`, `elk.rectpacking`, `dagre` | | `backgroundPattern` | `dots`, `grid`, `crosshair`, `blueprint`, `none` | | `edgeLabelBackground` | `none`, `canvas`, `custom` (with `edgeLabelBackgroundColor` as a colour) | | `cornerRadius` | 0 to 24 | | `borderWidth` | 0 to 4 | | `edgeThickness` | 1 to 4 | | `nodeSpacing` | 20 to 140 | | `rankSpacing` | 30 to 160 | | `shadowBlur` | 0 to 36 | | `shadowOffsetY` | 0 to 24 | | `shadowOpacity` | 0 to 1 | | `flowSpeed` | 0.6 to 4 | | `useGradients`, `useShadows`, `animatedFlow` | `true` or `false` | Anything Flowgraph doesn't recognise is ignored, and so is a value that isn't one of those listed. A number out of range is brought to the nearest end of its range, so `"cornerRadius":40` gives 24. A line that isn't valid JSON is ignored as a whole, and the diagram is drawn as if it had none. The easiest way to get exact values is to style the diagram on the website and export it, or to download the style with **Export → Theme JSON**: the line takes the same keys. ## Examples Each of these is drawn on this page in its own style, by the same renderer the editor uses. A service map in Midnight with a teal accent: ```mermaid flowchart LR web[Web app] --> api[Orders API] api --> queue[(Order events)] queue --> worker[Fulfilment worker] worker --> db[(Orders DB)] %% flowgraph-theme: {"v":1,"presetId":"midnight","colors":{"accentColor":"#2DD4BF"}} ``` A release process in Blueprint CAD, drawn with straight lines: ```mermaid flowchart TB build[Build] --> test{Tests pass?} test -->|yes| stage[Deploy to staging] test -->|no| fix[Fix and push] fix --> build stage --> prod[Release] %% flowgraph-theme: {"v":1,"presetId":"blueprint-cad","curveStyle":"linear"} ``` A sign-in sequence in Forest Canopy with a serif font: ```mermaid sequenceDiagram participant U as User participant A as App participant S as Sign-in service U->>A: Open the app A->>S: Ask for a session S-->>A: Session token A-->>U: Signed in %% flowgraph-theme: {"v":1,"presetId":"forest-canopy","fontFamily":"Lora"} ``` ## Leave it out Choose **Export → Mermaid code → Plain Mermaid** for code with none of Flowgraph's own lines: no style, no saved positions, no story. Use it when the code goes somewhere that should draw it its own way. --- # Preview Flowgraph diagrams in VS Code, with icons, layout and your theme Source: https://flowgraph.studio/guides/vs-code-extension/ Updated: 2026-12-04 Install 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. A diagram you arranged in Flowgraph Studio and saved into your repository looks different in most editors. VS Code's Markdown preview doesn't know the icons, the rich node cards, the positions you set by hand or your theme, so it draws a plainer, rearranged version. The Flowgraph Studio extension draws it the way the website does, beside your code, as you type. **Plan:** Free, Pro and Pro Max. The extension is free and needs no account. ## Install it In VS Code, open **Extensions** (`Ctrl+Shift+X`, or `Cmd+Shift+X` on a Mac), search for **Flowgraph Studio** and choose **Install**. You can also install it from its [Marketplace page](https://marketplace.visualstudio.com/items?itemName=flowgraph-studio.flowgraph-studio). Editors that install from Open VSX can get it from [its Open VSX page](https://open-vsx.org/extension/flowgraph-studio/flowgraph-studio). It needs VS Code 1.90 or later, and it's free. It draws everything on your computer and sends nothing anywhere, unless you choose **Open on flowgraph.studio** (below). ## Preview a Mermaid file Open a `.mmd` or `.mermaid` file and click **Open Preview to the Side** in the editor's title bar, or press `Ctrl+K V` (`Cmd+K V`). The preview redraws as you type, before you save. ![A Mermaid file in VS Code beside the Flowgraph preview, which draws it with icons in the Midnight theme](/guide-images/vscode-preview.webp) - **Move around:** drag the diagram. Hold `Ctrl` (`Cmd`) and scroll to zoom, or use **−**, **+**, **Fit** and **100%** at the top right. - **Layout:** a diagram you arranged on the website keeps its positions. They travel in the diagram's code as a `%% flowgraph-layout:` comment, so commit the code the website gives you and the preview draws it as you left it. - **Rich nodes and icons:** `@icon:` cards, subtitles and badges draw as they do on the website. See [Rich nodes and icons](/guides/rich-nodes-and-icons/). ## Diagrams in Markdown In a Markdown file, each ```` ```mermaid ```` block has two links above it: **Preview in Flowgraph** opens it in the preview, which then follows your cursor from block to block, and **Open on flowgraph.studio** opens it on the website. VS Code's own Markdown preview (`Ctrl+Shift+V` in a Markdown file) draws the blocks with Flowgraph too, so a README reads the way it will in your docs. ![VS Code's Markdown preview showing a README with its Mermaid diagram drawn by Flowgraph](/guide-images/vscode-markdown-preview.webp) To leave Markdown blocks to VS Code or another extension, turn off the setting **Flowgraph: Markdown Preview**. To hide the links above the blocks, turn off **Flowgraph › Markdown: Code Lens**. ## Mistakes in plain words When the code has a mistake, the preview keeps the last good drawing, faded, and explains the mistake at the bottom, in the same words the website uses. It's also listed in the **Problems** panel, on the line where it is. ![An unfinished arrow in a Mermaid file: the preview explains it, and the Problems panel lists it on its line](/guide-images/vscode-problems.webp) ## Use your repository's theme The preview uses the same style as the images your CI makes, looked up in this order: 1. If the diagram has its own `%% flowgraph-theme:` line, that style. See [Keep a diagram's style in its code](/guides/keep-diagram-style-in-code/). 2. If the repository has a `flowgraph.yml` with a `theme:` file (see [Keep README diagrams up to date in CI](/guides/keep-readme-diagrams-up-to-date-in-ci/)), that theme. 3. Otherwise the **Flowgraph: Theme** setting: a preset's name, such as `Midnight` or `Blueprint CAD`, or a theme file exported from Flowgraph Studio with **Export → Theme JSON**. 4. Otherwise Glass, Flowgraph's default. Change the theme file and open previews redraw. In a folder you haven't trusted, the folder's own theme setting is ignored, so a repository you've just cloned can't point it at files elsewhere on your computer. ## Edit diagrams visually Choose **Edit Visually** in the title bar of a `.mmd` file, or above a Markdown block, and Flowgraph's canvas opens beside the code. Drag, connect and restyle there; each change is written into the file as an ordinary edit, so Undo, Save and git work as usual. [Edit Mermaid diagrams visually in VS Code](/guides/edit-diagrams-visually-in-vs-code/) covers it in full. ## Export an image Click **Export…** in the preview, or run **Flowgraph: Export Diagram…** from the command palette. Choose PNG at 1×, 2× or 3× (with the theme's background or transparent), or SVG with its fonts embedded, then where to save it. The images are made the same way as on the website. Signed out, they carry the small Flowgraph Studio watermark that signed-out exports carry; signed in, your plan's watermark-free exports apply (below). ## Sign in for your plan Previews, export and the rest work without an account. Signing in brings your plan into VS Code: - **Pro icons:** on Pro and Pro Max, Gen AI icons (`@icon:genai:…`) draw in previews and in VS Code's Markdown preview. - **Exports:** Free's 10 watermark-free exports a month apply, shared with the website (each version of a diagram counts once); Pro has no limit. Open the **Flowgraph Studio** view in the activity bar and choose **Sign In**, or use **Sign in with Flowgraph Studio** in VS Code's Accounts menu. Your browser opens a Flowgraph Studio page asking you to connect the editor; choose **Connect**, and you're sent back to VS Code. The view then shows your plan and what's left this month. The connection is an API key named after your editor, such as "Visual Studio Code (connected app)". VS Code keeps it in your system's keychain, and it's listed in **Account settings → Render API**, where you can revoke it like any key (see [Connect by signing in](/guides/connect-ai-assistant-with-sign-in/)). **Sign Out** in the view revokes it for you. Your diagrams stay on your computer: the extension reads your plan, fetches the Pro icons, and counts exports by a fingerprint of the image, not the diagram. If the browser can't send you back to the editor, as in some remote setups, run **Flowgraph: Sign In with API Key** from the command palette and paste a key from **Account settings → Render API**. ## Keep a file and a saved diagram in step (Pro) On Pro and Pro Max, the **Saved Diagrams** section of the Flowgraph Studio view lists the diagrams in your account, by project. Click one to open it with its preview, in its own style, or choose **Save into Workspace…** to make it a `.mmd` file in your repository, linked to the saved diagram. To link a file you already have, open it and click **Save to Flowgraph Studio** in the line of links at the top of the file (or choose it from the editor's `…` menu, or right-click the file in the Explorer). It's saved to your account, in your repository's theme, and linked. From then on, the line at the top of the file offers **Push**, **Pull** and **Open on flowgraph.studio**, which opens the saved diagram itself: - **Push** sends the file's changes to the saved diagram. - **Pull** brings changes made on the website into the file. Arrange the diagram on the canvas, pull, and the new positions are in the file's code. - If the file and the saved diagram both changed since the last push or pull, VS Code asks: **Compare** them side by side, **Keep Mine** (the file's code replaces the site's, and the site's version is kept in its [version history](/guides/version-history/) first), or **Take Theirs** (the site's code replaces the file's; Undo or your version control brings the file's back). Saved diagrams belong to one account (projects can't be shared yet), so VS Code keeps the links for you, in this workspace, rather than in the repository. A teammate who wants the same file in their account saves their own copy. A linked file shows **Flowgraph** in the status bar; click it for the same actions. ## Draw diagrams from your code Right-click a folder or a source file in the Explorer and choose **Draw Code Diagram…**, or run it from the command palette. Pick a codebase map, module dependencies, a route map, a class diagram, a call map, or a function's flowchart: for a flowchart, the function your cursor is in is offered first. The diagrams are drawn on your computer by the same code as the website's [diagrams from a repository](/guides/visualize-a-github-repository/) and `flowgraph-cli`, so they match; nothing is sent anywhere and no account is needed. TypeScript, JavaScript, Python, Java, Go and C# are read. The result opens as Markdown, with notes on anything left out and the first diagram in the preview. Save it beside your code, or use **Open on flowgraph.studio** above a diagram to arrange it on the canvas. ## Keep README diagrams up to date from VS Code If the repository has a `flowgraph.yml` (see [Keep README diagrams up to date in CI](/guides/keep-readme-diagrams-up-to-date-in-ci/)), run **Flowgraph: Sync Diagrams** to do what CI does: draw each diagram it lists, render the images that changed, and fill in the README's blocks. The changes appear in Source Control, ready to review and commit. **Flowgraph: Check Diagrams Are Up to Date** changes nothing and says whether anything is out of date. Rendering images uses the API renders of the account you're signed in with (or a `FLOWGRAPH_API_KEY` in VS Code's environment); diagrams written as Mermaid need no account. Code diagrams and sync read the folder's files, and sync writes them, so they run only once you trust the folder. ## Open it on flowgraph.studio To arrange a diagram by hand, restyle it or share it, choose **Open on flowgraph.studio**: in the preview's title bar, from a Mermaid file's menu, from the command palette, or above a Markdown block. The website opens and asks before adding it as a new diagram, with its name and theme. Signed in, it's saved to your account like any other diagram. The diagram travels in the link itself, after the `#`, which browsers don't send to the server. A very long diagram doesn't fit in a link, so its link is copied instead: press `Ctrl+V` (`Cmd+V`) on the page that opens. When you're done on the website, copy its code back into the file. The positions come with it, so the preview in VS Code shows your new layout. See [Edit Mermaid on the canvas](/guides/edit-mermaid-on-the-canvas/) for what you can change there. --- # Connect Claude, Cursor or VS Code to Flowgraph Studio by signing in Source: https://flowgraph.studio/guides/connect-ai-assistant-with-sign-in/ Updated: 2026-12-01 Add Flowgraph Studio's MCP server to Claude, Claude Code, Cursor or VS Code with its address alone, approve the connection once, and revoke it whenever you like. No API key to copy. Flowgraph Studio's MCP server lets an AI assistant check and render Mermaid, find icons, and read and update the diagrams saved in your account. You can connect an assistant by signing in: add the server's address, approve the connection on a Flowgraph Studio page, and you're done. There's no key to copy, paste or keep secret. **Plan:** any plan can connect. Checking and rendering use your monthly API renders (Free 50, Pro 5,000, Pro Max 20,000). Reading and changing saved diagrams needs Pro or Pro Max. ## What happens when you connect ```mermaid sequenceDiagram participant You participant App as Claude, Cursor or VS Code participant FS as Flowgraph Studio You->>App: Add https://flowgraph.studio/mcp App->>FS: Register, then open the approval page FS->>You: Sign in if needed, and approve the app You->>FS: Connect FS->>App: A key for this app only App->>FS: Use the tools with that key ``` 1. The assistant opens a Flowgraph Studio page in your browser. If you aren't signed in, you sign in first. 2. The page says which app is asking, which account it will use and what it will be able to do, and where you'll be sent back to. 3. Choose **Connect**. The app receives a key of its own, and Flowgraph Studio lists it in **Account settings → Render API** named after the app, such as "Claude (connected app)". Choose **Cancel** and the app gets nothing. ![Flowgraph Studio’s approval page asks: Connect Claude to your Flowgraph Studio account? It lists what Claude will be able to do and says approving sends you back to claude.ai. Connect is chosen, and Account settings opens on the Render API keys, where Claude (connected app) is listed.](/guide-media/connect-with-sign-in.mp4 "Approve the app on Flowgraph Studio’s own page; the connection is then listed with your keys, where you can revoke it.") The approval page is always on flowgraph.studio. If a page asking for your Flowgraph Studio password or sign-in link shows any other address, close it. ## Claude (claude.ai and the desktop app) 1. In Claude, open **Settings → Connectors** and choose **Add custom connector**. 2. Name it `Flowgraph Studio` and enter `https://flowgraph.studio/mcp` as the server address. Leave any OAuth client ID and secret fields empty: Claude registers itself. 3. Choose **Connect** next to the new connector, then approve it on the Flowgraph Studio page. 4. In a chat, turn the connector on from the tools menu and ask, for example, "List my Flowgraph diagrams". Custom connectors added on claude.ai are available in the Claude desktop app too. Which Claude plans can add custom connectors is up to Anthropic; check Claude's help pages if you don't see the option. ## Claude Code Add the server without a header: ```bash claude mcp add --transport http flowgraph https://flowgraph.studio/mcp ``` Then, in Claude Code, run `/mcp`, choose **flowgraph**, and choose to authenticate. Your browser opens the approval page; after **Connect**, Claude Code shows the server as connected and lists its tools. Add `--scope user` to the command to use the connection in every project, or `--scope project` to put the server (without any key) in the repository's `.mcp.json`, so everyone on the team connects with their own account. ## Cursor Add the server to `~/.cursor/mcp.json`, or to `.cursor/mcp.json` in a project: ```json { "mcpServers": { "flowgraph": { "url": "https://flowgraph.studio/mcp" } } } ``` Open Cursor's settings at the MCP section. The server asks you to sign in; choose it, approve the connection in your browser, and the tools appear. ## VS Code Add the server to `.vscode/mcp.json` in your workspace, or with the **MCP: Add Server** command: ```json { "servers": { "flowgraph": { "type": "http", "url": "https://flowgraph.studio/mcp" } } } ``` Start the server from the file or the MCP view. VS Code asks whether to let it sign in to flowgraph.studio; allow it, approve the connection in your browser, and the tools become available to Copilot's agent mode. ## Other assistants Any client that supports the MCP authorization spec, with dynamic client registration and PKCE, connects the same way: give it `https://flowgraph.studio/mcp` and no key. If a client can't sign in, use an API key instead, as the [MCP server guide](/guides/mermaid-mcp-server/) describes. ## What a connected app can do A connected app can: - check and render Mermaid diagrams, using your monthly API renders; - search the icons, which is free; - list, read, create and change your saved diagrams, on Pro and Pro Max. It can't delete diagrams, change your account or plan, or create keys. Every change it makes keeps the previous state in [version history](/guides/version-history/), so any change can be undone. To give an assistant rendering only, with no access to saved diagrams, create a key without **Read and change saved diagrams** and use it instead of signing in. ## See and revoke connections Open **Account settings → Render API**. Each connected app is listed with your keys, with when it was created and last used. Choose **Revoke** and the app is cut off at once; its next request is refused. To use it again, connect it again. An app that offers a sign-out can also give its connection back itself (through the standard OAuth revocation address, `/oauth/revoke`), and it then disappears from the list. A connection counts towards the 10 active keys an account can have. With 10 already, connecting fails with a message to revoke one first. ## Troubleshooting - **"That app isn't registered."** The app's registration has expired or was made against another server. Remove the connector in the app and add it again. - **"That address isn't the app's."** The app asked to send you somewhere it hadn't registered, so Flowgraph Studio stopped. Remove and add the connector again; if it keeps happening, the app may not support signing in yet. - **"Accept the updated Terms first."** Open Flowgraph Studio, accept the updated Terms of Service, then connect again. - **The app says it's connected, but saved-diagram tools refuse.** Reading and changing saved diagrams needs Pro or Pro Max. - **Too many registrations.** Adding apps from the same network many times in a minute is limited. Wait a minute and try again. ## Next steps - [Use a Mermaid MCP server to render and review AI diagram edits](/guides/mermaid-mcp-server/): the tools and a safe way to have an assistant change a diagram. - [Give an AI assistant Flowgraph's guides with llms.txt](/guides/give-ai-assistants-flowgraph-docs/): so it writes Mermaid that works the first time. --- # Give an AI assistant Flowgraph's guides with llms.txt Source: https://flowgraph.studio/guides/give-ai-assistants-flowgraph-docs/ Updated: 2026-12-01 Point Claude, Cursor, Claude Code or any assistant at flowgraph.studio/llms.txt or llms-full.txt, so it knows the Mermaid syntax, rich nodes and tools Flowgraph Studio supports, and writes diagrams that work the first time. Assistants write Mermaid from memory, and memory goes out of date: a keyword that changed, an icon name that doesn't exist, a rich-node option Flowgraph Studio added last month. Flowgraph Studio publishes its guides in two plain-text files written for AI assistants, following the [llms.txt](https://llmstxt.org) convention. Give an assistant one of them and it works from the current guides, not from what it half remembers. **Plan:** none needed. The files are public and free to read. ## The two files | File | What it holds | Use it when | | --- | --- | --- | | [`/llms.txt`](https://flowgraph.studio/llms.txt) | A short index: the MCP server, API and CLI for agents, then every doc, guide and blog post, with a one-line summary and a link. | The assistant can fetch web pages, and should read only what it needs. | | [`/llms-full.txt`](https://flowgraph.studio/llms-full.txt) | Every guide in full, as Markdown, with its address and the date it was last updated. About 350 KB. | The assistant can't fetch pages, or you want it to know everything at once. | Both are rebuilt with the site on every release, so they always match the guides you can read here. ## Claude Code and other agents that fetch pages Tell the agent where to look. In Claude Code, add a line to the project's `CLAUDE.md`: ```markdown Diagrams in this repository are Mermaid, drawn with Flowgraph Studio. Before writing or changing one, read https://flowgraph.studio/llms.txt and fetch the guides for the diagram type you need. ``` The agent reads the index, picks the guides that apply, such as the [flowchart cheat sheet](/guides/mermaid-flowchart-cheat-sheet/) or [rich nodes and icons](/guides/rich-nodes-and-icons/), and fetches only those. The same line works in `AGENTS.md`, Cursor rules or Copilot instructions. ## Cursor Cursor can index documentation by address. Open Cursor's settings at **Indexing & Docs**, add a doc, and enter `https://flowgraph.studio/llms-full.txt`. Then mention it in a chat with `@Docs`, for example: > @Docs Flowgraph Studio: draw our checkout flow as a flowchart with rich nodes and AWS icons. ## Claude Projects and other chat assistants For an assistant that can't fetch pages, add the full file as knowledge: 1. Open [flowgraph.studio/llms-full.txt](https://flowgraph.studio/llms-full.txt) and save it. 2. In a Claude Project, add it under the project's knowledge. In other assistants, attach it to the chat or to the custom assistant's files. 3. Ask for the diagram. The assistant now has the guides at hand, with the syntax Flowgraph Studio supports. The file is large. If the assistant's limit is small, give it only the guides you need instead: llms.txt lists every one with its address. ## Docs and tools work best together The guides tell an assistant what to write. Flowgraph Studio's MCP server lets it check what it wrote: `validate_mermaid` catches a mistake before you see it, `search_icons` finds real icon names, and `render_diagram` shows a preview. With both, an assistant writes a diagram from the guides, checks it, fixes what failed and shows you the result. [Connect the MCP server by signing in](/guides/connect-ai-assistant-with-sign-in/): Claude, Claude Code, Cursor and VS Code need only its address. ## Follow new guides New guides appear in llms.txt with each release. To hear about them yourself, subscribe to the feeds in any feed reader: - Guides: `https://flowgraph.studio/guides/rss.xml` - Blog: `https://flowgraph.studio/blog/rss.xml`, with each post in full. --- # Keep README architecture diagrams up to date in CI Source: https://flowgraph.studio/guides/keep-readme-diagrams-up-to-date-in-ci/ Updated: 2026-11-30 Redraw the diagrams in your README from your code and configuration on every push, with flowgraph sync, on GitHub, GitLab, Bitbucket or Azure DevOps, and commit only the ones that changed. An architecture diagram in a README is right on the day it's drawn. `flowgraph sync` keeps it right afterwards: on every push, your CI job redraws the diagrams you list from the repository's own files, renders the ones that changed, and commits them into the README. This guide sets it up from scratch. **Plan:** Free, Pro and Pro Max. Each image rendered uses one API render from your monthly allowance (Free 50, with a small watermark; Pro 5,000; Pro Max 20,000), and an unchanged diagram uses none. Diagrams kept as Mermaid need no renders at all. Diagrams saved in your account (`draw: saved` and `save-to:`) need Pro or Pro Max. ## How it works ```mermaid flowchart LR push[Push to main] --> job[Your CI job runs
flowgraph sync] job --> draw[Draw each diagram
from the checkout] draw --> changed{Changed?} changed -->|no| done[Nothing to commit] changed -->|yes| render[Render the image] render --> commit[Commit the image
and the README block] ``` - **Your code stays where it is.** Sync runs on the code your CI checked out, so private repositories need no extra access. Only the Mermaid of a diagram that needs rendering is sent to Flowgraph Studio's API. - **The same commit gives the same diagram.** Diagrams drawn from code and configuration use no AI, so a changed diagram means the system changed. - **Only what changed is rendered and committed.** An unchanged diagram uses none of your monthly renders, and sync never commits files other than its own. ## 1. Create an API key Sign in, open **Account settings → Render API**, and choose **Create key**. Store it as a secret in your CI system, named `FLOWGRAPH_API_KEY`. A free account works; its images carry a small watermark. You can skip the key if every diagram is written as Mermaid (`format: mmd`): GitHub, GitLab and Azure DevOps draw Mermaid in a README themselves, so nothing needs rendering. ## 2. List the diagrams in flowgraph.yml Add `flowgraph.yml` at the root of the repository. Each entry names a diagram and says what to draw: ```yaml diagrams: architecture: map # the codebase map services: compose # services from docker-compose.yml data-model: draw: sql # the ER diagram from your migrations out: docs/data-model.png checkout-flow: draw: flow file: src/orders.ts function: Orders.place format: mmd # kept as Mermaid: no key or render needed ``` | `draw` | Drawn from | | --- | --- | | `map`, `deps`, `routes`, `classes`, `calls`, `flow` | The code: a codebase map, module dependencies, routes, class diagrams, a call map, or one function's flowchart (TypeScript, JavaScript, Python, Java, Go and C#) | | `compose`, `kubernetes`, `terraform`, `openapi`, `pipeline`, `sql`, `prisma`, `packages` | The repository's configuration: Docker Compose, Kubernetes manifests, Terraform, OpenAPI, CI pipelines, SQL or Prisma schemas, and workspaces | | `saved` | A diagram saved in your Flowgraph Studio account (see [below](#diagrams-drawn-in-flowgraph-studio)) | Images go to `docs/diagrams/.svg` unless `out` says otherwise. A top-level `theme:` (the file from **Export → Theme JSON** in the editor) styles them all. The [flowgraph-cli README](https://www.npmjs.com/package/flowgraph-cli) lists every setting. ## 3. Mark where each diagram goes In `README.md`, put a pair of markers where each diagram should appear, named as in `flowgraph.yml`: ```markdown ## Architecture ``` Each sync replaces what is between the two lines, with a link to the image, or a Mermaid block for an `mmd` diagram, and leaves the rest of the README alone. ## 4. Run it locally first ```sh FLOWGRAPH_API_KEY=fg_… npx --yes flowgraph-cli@0.3.0 sync ``` It writes the images, fills in the README and saves `.flowgraph-sync.json`, which remembers what it rendered. Run it again: with nothing changed, it renders nothing and changes nothing. Commit the result once, so the first CI run starts from it. ## 5. Add it to your CI Each host has a ready-made integration. Every one commits with the message `Update diagrams [skip ci]`, so the diagrams' own commit doesn't start another run. ### GitHub Actions ```yaml # .github/workflows/diagrams.yml name: Diagrams on: push: branches: [main] permissions: contents: write concurrency: diagrams jobs: sync: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: theorence-labs/flowgraph-sync-action@v1 with: api-key: ${{ secrets.FLOWGRAPH_API_KEY }} ``` ### GitLab CI/CD Turn on **Settings → CI/CD → Job token permissions → Allow Git push requests to the repository**, so the job can push with its own token (GitLab 18.4 or later, every plan). Then include the component: ```yaml # .gitlab-ci.yml include: - component: gitlab.com/flowgraph-studio/flowgraph-sync/sync@1.1.0 ``` ### Bitbucket Pipelines The pipe draws and commits; the step pushes, because Bitbucket's push credentials are only reachable from the step itself: ```yaml # bitbucket-pipelines.yml pipelines: branches: main: - step: name: Diagrams script: - pipe: docker://theorencelabs/flowgraph-sync-pipe:1.1.0 variables: FLOWGRAPH_API_KEY: $FLOWGRAPH_API_KEY - git push origin "HEAD:$BITBUCKET_BRANCH" ``` ### Azure Pipelines Allow **`` Build Service** to **Contribute** to the repository (**Project settings → Repositories → Security**), and add `FLOWGRAPH_API_KEY` as a secret pipeline variable: ```yaml # azure-pipelines.yml trigger: branches: include: [main] pr: none pool: vmImage: ubuntu-latest steps: - checkout: self persistCredentials: true - task: NodeTool@0 inputs: versionSpec: 22.x - script: npx --yes flowgraph-cli@0.3.0 sync --push env: FLOWGRAPH_API_KEY: $(FLOWGRAPH_API_KEY) ``` The next push draws every diagram and commits them. After that, a push commits only the diagrams that changed. ## Diagrams drawn in Flowgraph Studio Not every diagram can be read from code: a target architecture, or an overview you've arranged by hand. On Pro and Pro Max, sync works with diagrams saved in your account too. It needs a key with **Read and change saved diagrams** ticked when you create it. **Put a saved diagram in the README** with `draw: saved` and its id. The id is in the editor's address (`/editor?diagram=`), and `npx flowgraph-cli diagrams` lists them all: ```yaml diagrams: target-architecture: draw: saved id: 5f2c9a7e ``` It's rendered with the theme it has in the app, so restyling it in the editor changes the README on the next sync: ![The saved diagram Checkout architecture is open in the editor, in the Glass theme. Midnight is chosen in the Style panel and the diagram turns dark; then Blueprint CAD, and it turns blue.](/guide-media/draw-saved.mp4 "draw: saved renders the diagram as it is in the app, theme and all: change it here, and the next sync puts the new look in the README.") Edits in the app don't start your CI, so also run the sync on a schedule. In GitHub Actions, add `schedule: [{ cron: '0 6 * * *' }]` under `on:`. **Keep a saved diagram in step with the code** with `save-to:` on a diagram drawn from the repository. Sync puts the new drawing into the saved diagram and keeps its title, theme and the positions you gave nodes in Manual mode. Each change is a new entry in its [version history](/guides/version-history/), so **Compare with current** shows exactly what the code changed: ```yaml diagrams: services: draw: compose save-to: 81b3d0c4 ``` ![The saved diagram Services, kept up to date by flowgraph sync, is open. Version history lists the version from before the last sync, Before an API change; it is chosen, and Compare with current shows the new cache service and its connection marked as added.](/guide-media/save-to.mp4 "With save-to, each sync that changes the diagram adds a version: Compare with current shows what the code changed.") A changed diagram also shows **Changed since review**, if you [review your diagrams](/guides/keep-architecture-diagrams-up-to-date/). ## In pull requests `flowgraph sync --check` changes nothing and needs no key. It says which diagrams will change once the request is merged, and exits with status 1 if any will. Use it as an advisory check rather than one that blocks a merge: the job on `main` updates the diagrams anyway. - **GitHub:** run the action with `mode: check` on `pull_request`. - **GitLab:** also include `gitlab.com/flowgraph-studio/flowgraph-sync/check@1.1.0`, which only warns by default. Sync never pushes from a pull or merge request's build, which is a merge of it into its target: `--push` refuses there. ## Troubleshooting | What you see | What to do | | --- | --- | | `needs rendering: set FLOWGRAPH_API_KEY` | Add the key as a secret and pass it to the step, or use `format: mmd` for that diagram | | The push is refused on GitHub | Branch protection blocks direct pushes to `main`: allow GitHub Actions to push | | The push is refused on GitLab | Turn on **Allow Git push requests to the repository**, or set `FLOWGRAPH_PUSH_TOKEN` to a token with the `write_repository` scope | | `A pipe can't push from Bitbucket Pipelines` | Add the `git push origin "HEAD:$BITBUCKET_BRANCH"` line after the pipe | | The push is refused on Azure DevOps | Allow the Build Service to **Contribute**, and keep `persistCredentials: true` | | `--push doesn't run for a pull or merge request` | Run `sync --check` in pull requests, and push from `main` | | A diagram keeps changing without code changes | Check that its files aren't generated during the build; sync leaves its own output out of what it draws | To see a repository's diagrams before setting up sync, [draw them in the app](/guides/visualize-a-github-repository/): the import uses the same generators. --- # AI architecture overview: draw a repository's architecture with AI Source: https://flowgraph.studio/guides/ai-architecture-overview-of-a-repository/ Updated: 2026-11-28 Have AI read a public repository on GitHub, GitLab, Bitbucket or Azure DevOps and draw what the system is made of and how its parts connect. What it reads, what it costs in AI credits, how caching by commit works, and what to do when it fails. Most diagrams Flowgraph Studio draws from a repository come straight from its files, with no AI: Compose services, Kubernetes manifests, CI pipelines, SQL migrations, module dependencies. They show exactly what the files spell out. An **AI architecture overview** answers a different question: "What is this system made of, and how do its parts talk to each other?" Flowgraph reads a digest of the repository, Claude describes the parts and connections it finds, and the app draws them as a flowchart you can edit like any other diagram. **Plan:** Pro and Pro Max. Each overview uses 5 AI credits, or none when one of the same commit was already made. Pro includes 100 AI credits a month and Pro Max 300 (see [AI credits](/guides/ai-credits-and-packs/)). **Hosts:** public repositories on GitHub, GitLab, Bitbucket and Azure DevOps. Private repositories work too, after you agree for each one (see [below](#private-repositories)). ## What an overview shows An overview is a flowchart of the system's parts and how they connect: - **Parts** are things that run or hold data: apps and services, background jobs and scheduled tasks, databases, caches, queues, file storage, the clients people use (a browser app, a mobile app, a command-line tool), and outside services it calls, such as a payment provider or an email API. For a library or a single program, the parts are its main modules. - **Connections** are interactions the files show, labelled in a few words: "HTTP", "SQL", "jobs", "webhooks", "reads". - **Groups** are real boundaries the files show, such as a deployment ("Kubernetes cluster"), a tier ("Frontend", "Backend") or a package in a monorepo. Each part shows its main technology where the files say, with an icon where there is one. An overview has at most 16 parts, 40 connections and 8 groups; 5 to 12 parts is usual. It also has a title, a one- or two-sentence summary, and a note on what the AI couldn't see. ![An AI architecture overview of the Spring PetClinic sample on GitLab: a web browser calling MVC controllers over HTTP inside a Spring Boot application group, with repositories, the domain model, Ehcache, Thymeleaf views and Actuator, and SQL connections to HSQLDB and MySQL](/guide-images/ai-architecture-overview.webp) ## Make an overview 1. In Projects, choose **Import repository**, paste the repository's address and choose **Scan repository**. For a large repository, paste the address of one folder instead (see the guides for [GitHub](/guides/visualize-a-github-repository/), [GitLab](/guides/visualize-a-gitlab-repository/), [Bitbucket](/guides/visualize-a-bitbucket-repository/) and [Azure DevOps](/guides/visualize-an-azure-devops-repository/)). 2. In the scan result, find **AI architecture overview**. It shows the price and your balance, such as "Uses 5 credits (100 left this month), or none if one of this commit was already made." 3. Choose **Make overview**. Flowgraph reads the code and asks the AI. This can take a minute. 4. The overview joins the list of diagrams to add, ticked. Add it with the others, 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 a route chosen to trace, each using 5 credits with 100 left this month](/guide-images/import-ai-overviews.webp) Signed out, the row offers **Sign in**. On Free, it says the overviews are included in Pro and Pro Max and offers **Upgrade**. A folder from your computer has no AI overview; its diagrams are all drawn without AI. Under it, **AI request flow** traces one request through the code as a sequence diagram instead. It costs the same and is cached the same way. See [AI request flow: trace a route through the code](/guides/ai-request-flow-sequence-diagram-from-code/). ## What it reads Flowgraph's server reads the repository from its host at the commit you scanned, and builds a digest for the AI, most important first: - an outline of the folders; - the README, and architecture notes near the top (`architecture.md`, `design.md`, `overview.md`), up to 8,000 characters each; - manifests and configuration, such as `package.json`, `pyproject.toml`, `go.mod`, `pom.xml`, `.csproj` files, Dockerfiles, Compose files, CI workflows, Terraform and Kubernetes manifests, up to 6,000 characters each; - the start of the main source files: where programs start, and files in folders such as `routes/`, `handlers/` and `controllers/`, their first 200 lines and at most 8,000 characters each. At most 80 files are read, and the digest is at most about 150,000 characters. The overview cites only files whose text was in it. When the code is in TypeScript, JavaScript, Python, Java, Go or C#, your browser first reads its structure, as for the module dependencies and the route map: which files import which, and the routes with their handlers. Only those names are sent with the request, never the code. Flowgraph then reads the files that matter most, where the program starts and the files most others import, instead of choosing by name, and tells the AI the real imports and routes. It reads no more of the code than without them. For other languages, or when the code can't be read, files are chosen by name and place. ## What it never reads Before anything is sent, for public and private repositories alike: - **Files that hold credentials are left out:** `.env` files, keys and certificates, credential and secrets files, `.tfvars`, service account keys, encrypted files, folders such as `.ssh` and `.aws`, and Kubernetes Secret manifests. - **Values that look like secrets are replaced** with `[removed]`: cloud access keys, tokens from GitHub, GitLab, Stripe, Slack and AI providers, private keys, and written-out passwords. - **Tests, examples, fixtures, mocks, scripts, migrations and generated code** aren't read as source, since they describe the code rather than being it. - **Large files** aren't read: source files over 200 KB, configuration over 300 KB, or a README over 500 KB. The digest goes to Anthropic, our AI provider, which writes the overview. The repository's files aren't kept. ## Cached by commit A commit never changes, so an overview of a public repository is kept for 30 days for that commit and folder, and shared: the next person to make one of the same commit gets it at once, and **it isn't charged**. The row says so: "or none if one of this commit was already made". Flowgraph still asks the host about the repository each time, so one that has been deleted or made private stops being served. Overviews of private repositories are never cached or shared with other accounts, so each one uses its credits. ## How it differs from the diagrams drawn without AI | | Diagrams from the files | AI architecture overview | | --- | --- | --- | | How it's made | Read from configuration and code by rules, no AI | Claude reads a digest and describes the parts | | What it shows | Exactly what one kind of file says: services, pipelines, tables, imports, routes | The whole system's parts and connections, across kinds of files | | Same commit, same result | Always | Cached for 30 days; **Regenerate** may give a different answer | | Plan | Every plan (adding them needs an account) | Pro and Pro Max | | Cost | Free | 5 AI credits, or none from the cache | | Who reads the files | Your browser draws them (private repositories through your connection) | Flowgraph's server reads them and sends a digest to the AI | | Keep it current | **Refresh** redraws from the latest commit and shows what changed | **Regenerate** makes a new one beside it | Use both. The overview is a quick map of an unfamiliar codebase; the diagrams from the files are the exact record of one part of it. ## Check it against the code An overview describes only what the files it read show, so it can miss a part or misread how two parts connect. Open it and choose **From GitHub** in the editor's top bar (or **From GitLab**, **From Bitbucket**, **From Azure DevOps**). The panel lists each part with what it does and the files it was read from, linked to the host at that commit, and above them the AI's note on what it couldn't see, such as folders that weren't read or a README claim the code didn't confirm. ## Regenerate it AI overviews aren't refreshed like the other diagrams. Instead, **Regenerate** in the **From GitHub** panel reads the branch's latest commit and makes a new overview as a new diagram beside the earlier one, named with its commit. It always asks the AI again, so it uses 5 AI credits even when an overview of that commit is in the cache. It needs room for one more diagram in your plan. ## Limits, and when it fails If an overview fails on our side, its credits are given back. The message says what to do: - **"…didn't send the repository's files just now, so no overview was made and nothing was counted."** The host failed to send many of the files. Try again in a minute. - **"…is limiting how often Flowgraph can read repositories right now."** Try again in a few minutes. - **"The overview was too large to finish."** Scan one folder of the repository instead. - **"The AI couldn't find enough parts and connections to draw."** An overview needs at least two parts and one connection. Scan the folder that holds the application. - **"Flowgraph couldn't find code or configuration to read in this repository."** There is nothing it can describe. - **"Too many requests. Wait a minute and try again."** Too many AI requests from your account in a short time. - **Not enough credits.** The row says how many you have left, and **Buy credits** appears under the button. An overview already in the cache is still free, and one that costs more than you have is refused before anything is sent to the AI. Choose **Try again** in the row after a failure. ## Private repositories With Pro and Pro Max, connect the host first (see [Private repositories](/guides/private-repositories/)), then scan the repository and choose **Make overview** as above. The first time, for each repository, Flowgraph asks before any of its code is read for AI. It says that excerpts of code will be sent to Anthropic, that they aren't used to train models, and that Anthropic may keep them for up to 30 days for safety monitoring. Choose **Agree and make overview**, or **Not now**. Your answer is remembered for that repository; to withdraw it, find the repository under **AI overviews allowed** in Account and choose **Withdraw**. A private overview is read with your own connection, made for you alone, and never cached. Before it is added, you choose the names people will see, including the **Description, written by the AI**. For how credits work and how to buy more, see [AI credits](/guides/ai-credits-and-packs/). --- # AI request flow: trace a route through the code as a sequence diagram Source: https://flowgraph.studio/guides/ai-request-flow-sequence-diagram-from-code/ Updated: 2026-11-28 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. 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](/guides/ai-credits-and-packs/)). **Hosts:** public repositories on GitHub, GitLab, Bitbucket and Azure DevOps, and private ones after you agree for each (see [Private repositories](/guides/private-repositories/)). It is the second kind of AI overview. The first, the [AI architecture overview](/guides/ai-architecture-overview-of-a-repository/), 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](/guides/visualize-a-github-repository/), [GitLab](/guides/visualize-a-gitlab-repository/), [Bitbucket](/guides/visualize-a-bitbucket-repository/) and [Azure DevOps](/guides/visualize-an-azure-devops-repository/)). 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](/guide-images/import-ai-overviews.webp) ## 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](/guide-images/ai-request-flow.webp) - **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](/guide-images/ai-request-flow-source.webp) ## 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](/guides/visualize-a-github-repository/#from-the-code). | | 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](/guides/ai-architecture-overview-of-a-repository/#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. --- # Delete several diagrams at once, and restore them from the Bin Source: https://flowgraph.studio/guides/restore-deleted-diagrams-bin/ Updated: 2026-11-26 Tick diagrams, whiteboards and explainers on the Projects page and delete them together. On Pro and Pro Max they stay in the Bin for 14 days, with projects, saved templates, snippets and style presets, so you can restore them. Cleaning up a project usually means deleting more than one thing. Flowgraph Studio lets you delete several items in one go, and on Pro and Pro Max keeps what you delete in a Bin for 14 days, in case you change your mind. **Plan:** deleting several at once works on every plan. The Bin is part of Pro and Pro Max. Signed out and on Free, deleting is permanent, and the question before deleting says so. ## Delete several at once 1. On the Projects page, open a project, **Recent**, or **Needs review**. 2. Choose **Select** above the list, then tick the items, or use **Select all**. 3. Choose **Delete…**. The question names what goes, such as “Delete 3 diagrams and 1 whiteboard?”, and where it goes. Every kind of item in a project can be ticked: diagrams, whiteboards, LinkedIn and Prism explainers, and design documents. To delete a project with everything in it, use **Delete project** in the project's **⋯** menu. ## What goes to the Bin On Pro and Pro Max, these go to the Bin when you delete them: - diagrams, whiteboards, LinkedIn explainers, Prism explainers, and design documents; - projects, with the diagrams in them; - saved templates; - snippets; - style presets. Each stays for 14 days from when it was deleted. After that, the nightly clean-up deletes it for good, with its version history, reviews, and share links. ## Restore, or delete for good Open **Bin** in the Projects sidebar. Each item shows its kind, the project it was in, when it was deleted, and how many days it has left. - **Restore** brings an item back. Tick several to restore them together. - A project comes back with the diagrams that were deleted with it. - A diagram whose project is gone goes back to your default project, and the Bin tells you. - **Delete forever** removes an item now, and **Empty bin** removes everything. Both ask first, and neither can be undone. ## Limits and plan changes Items in the Bin don't count toward your plan's limits. Restoring one has to fit them: if you moved to Free with 25 diagrams already in use, restoring another is refused, and the Bin says why. Delete something else first, or upgrade. If you move from Pro to Free, what is already in the Bin can still be restored until its 14 days end. Deleting on Free is permanent from then on. ## Shared items in the Bin While a diagram is in the Bin, its share links stop working. For a shared whiteboard, the people you invited and anyone with its guest link lose access, and anyone on it is disconnected after the board is saved. Restore it and the links and invitations work again, as they were. The API and coding assistants don't see items in the Bin. Your account download (Account → **Download my data**) lists them separately, each marked with when it was deleted. ## Across devices Deleting on one device removes the item from your other devices the next time they sync. If you changed a diagram on another device while it was being deleted, your changes are kept as a copy marked “(conflict copy)”, and the Bin keeps the diagram as it was. --- # Version history: automatic versions, named versions, and restore Source: https://flowgraph.studio/guides/version-history/ Updated: 2026-11-26 Flowgraph Studio keeps earlier versions of every diagram saved to your account. See how long automatic versions are kept on each plan, how to name a version so it is kept until you delete it, and how to restore or compare one. Every diagram saved to your account has a version history: the earlier states of its code and style, each with a preview. You can look at any of them, compare it with the diagram as it is now, and put it back. It works the same way for whiteboards, explainers and design documents. **Plan:** Free, Pro and Pro Max, signed in. Automatic versions are kept for 3 days on Free, 90 days on Pro and a year on Pro Max. Named versions are kept until you delete them, on every plan. ## Open the history Open **Version history** (the clock in the top bar). The list shows the diagram as it is now, your named versions, and then the automatic versions by day, newest first. Select one to see its preview. ## Automatic versions Your work always saves as you edit; version history keeps checkpoints of it. An automatic version is kept: - every 10 minutes while you edit, or as often as you chose (see below), - before big changes: an AI change, a refresh from a repository, applying a style, and a restore, - as an API key, a coding assistant (MCP) or someone on a shared whiteboard changes it, on the same schedule. They are kept for 3 days on Free, 90 days on Pro and 365 days on Pro Max. A diagram keeps up to 200 automatic versions on Free and Pro, and 500 on Pro Max; past that, the oldest go first. ### How often When you first sign in, Flowgraph asks how often to keep an automatic version: every 5, 10, 15 or 30 minutes, or every hour. Skip the question to keep 10 minutes. Change it any time in **Account settings**, under **Editor**. This doesn't change how your work saves. Every edit is saved to your account as you make it; the setting only decides how often a checkpoint goes into the history. A shorter interval gives you more points to go back to, and reaches the cap sooner. Versions before big changes are kept whatever you choose. ## Named versions **Save version** keeps the diagram as it is now under a name, such as "Base", "Sent to client" or "Agreed in the 12 May review". - Named versions are kept until you delete them. They don't expire with your plan's window, and automatic versions never push them out. - A diagram can have up to 10 named versions. At 10, delete one before you save another. - Select a named version to **Rename** or **Delete** it. - To keep an automatic version, select it and choose **Name it**. It becomes a named version. Named versions are on every plan, Free included. ## Restore, compare, or copy - **Restore this version** brings back that version's code and style. The diagram as it was just before is kept as a version first, so you can restore it again, and Ctrl+Z undoes the restore. - **Compare with current** shows the two side by side, with what changed marked. - **Open as a copy** makes the version a new diagram and leaves this one as it is. A copy of a diagram, from **Open as a copy** or **Duplicate**, starts with no history of its own. The history stays with the diagram it came from. ## Shared whiteboards A shared whiteboard's history is its owner's, kept under the owner's plan. Everyone the board is shared with can open it from the top bar. The owner and editors can save, name, rename and delete versions, and restore one, which changes the board for everyone on it. Viewers can look at versions and open one as a copy. ## Changing plans Moving to a larger plan keeps automatic versions longer, and more of them, from then on. After a move to a smaller plan, for example when a paid plan ends or you move from Pro Max to Pro, automatic versions past the new window or cap are hidden at once. They are removed 30 days later. If you upgrade again within those 30 days, they come back. Named versions are always kept, whatever the plan. ## Where history is kept History is part of your account, so it is on every device you sign in on. Diagrams kept only in this browser have no history; sign in to start one. **Download my data** in Account settings includes every version, with its name. --- # Draw and change Mermaid diagrams with the AI assistant Source: https://flowgraph.studio/guides/ai-assistant-diagrams/ Updated: 2026-11-25 Describe a system and get a Mermaid diagram with real icons, or say what to change in the open one. How the AI assistant works, what it costs, and how to write requests that work. The AI assistant writes Mermaid for you. Describe a system and it draws a new diagram, with components and icons from the editor's own libraries. Or open a diagram and say what to change, and it edits the code the way you would by hand. This guide covers both, with tips for requests that get a good diagram the first time. **Plan:** Pro and Pro Max. Each diagram the AI creates or changes uses 2 AI credits, from the 100 a month included in Pro or the 300 in Pro Max. Signed out, the panel asks you to sign in; on Free it shows what's included and a **See Pro** button. ## Open the assistant In the editor, click **AI** in the top bar. A panel opens with three choices: - **Change diagram**: edit the open diagram. It's the default when a diagram is open, and it's turned off for an empty one. - **New diagram**: draw a new diagram from a description. - **Animated explainer**: draw a topic and explain it in captioned steps, for a GIF or video. See [Animate a Mermaid diagram](/guides/animate-mermaid-diagram/). ![The AI assistant panel with Change diagram chosen, a request to add a Redis cache, the price of 2 credits with the balance left, and the Change diagram button](/guide-images/ai-assistant-panel.webp) Type your request, between 3 and 2,000 characters, and click **Create diagram** or **Change diagram**. **Ctrl** + **Enter** sends it too. Under the box, the panel shows the price and your balance, such as "2 credits · 86 of 100 credits left this month". ## Draw a new diagram Describe the system or process the way you'd explain it to a colleague: the parts, how they connect, and any boundaries you want shown. > A serverless order pipeline on AWS: API Gateway, Lambda, SQS and DynamoDB, with CloudWatch monitoring. Group everything inside one AWS account. The assistant: - **Picks the diagram type.** A flowchart for architectures, pipelines and processes, a sequence diagram for interactions over time, a state diagram for lifecycles, an ER diagram for data models, a class diagram for code structure, and a Gantt chart for schedules. Name a type in your request to choose it yourself. - **Uses real icons.** Components are drawn as [rich nodes](/guides/rich-nodes-and-icons/) with icons that exist in the editor's libraries. Name the cloud provider (AWS, Google Cloud or Azure) to get its official service icons. - **Keeps it readable.** Short titles and labels, one idea per box, and groups only for real boundaries such as an account, a network or a team. The result is saved as a new diagram in the current project, named by the AI, and opens in the editor. The panel says what it drew. ## Change the open diagram With a diagram open, choose **Change diagram** and say what you want: - "Add a Redis cache between the API and the database." - "Group the services into a VPC." - "Make the queue a dead-letter queue and add a retry arrow." - "Turn this into a top-to-bottom flowchart." The assistant makes that change and keeps the rest as it was: the same node ids, labels, comments and styles. Positions you set in Manual mode stay too, because they're tied to the node ids. New boxes follow the diagram's own conventions, rich nodes or plain. The change goes into the code editor like any other edit, so **Ctrl** + **Z** undoes it. If the diagram is saved to your account, the version before the change is also kept in **Version history**, so you can go back to it later. If a change can't be made in that diagram type, the assistant does the closest reasonable thing and says so in its summary. ## When Mermaid can't read the answer Every answer is checked before it reaches the canvas. If Mermaid can't read it, the app sends the error back to the AI once and asks it to fix the code. That fix is free. If the fixed answer still can't be read, it goes into the editor anyway and the status bar shows the error, so you can correct it by hand or undo it and ask again in other words. ## Write requests that work ```mermaid flowchart LR ask([Your request]) --> ai[AI assistant] ai --> check{Mermaid
reads it?} check -->|yes| canvas[Canvas] check -->|no, once| fix[Free fix] fix --> canvas ``` - **Name the parts.** "Orders API, Postgres, Stripe" draws better than "a backend". - **Say what connects to what.** Arrows are the point of most diagrams; describe them. - **Name the boundaries.** "Inside the VPC", "on the customer's device", "owned by the payments team". - **Ask for one change at a time.** Small changes are easier to check, and each one can be undone on its own. - **Keep it under about 30 boxes.** For a large system, draw an overview and a diagram for each part, and [link them](/docs/accounts-and-saving#linked-diagrams). ## Good to know - **Check before you share.** AI can make mistakes. Read the diagram against what you know of the system. - **Your data.** Your request and the open diagram's code are sent to Anthropic, our AI provider, to write the answer. They aren't used to train models. - **Short bursts are limited.** If you send many requests in a few seconds, the assistant asks you to wait a minute. - **Credits.** Each request uses its credits once, and they're given back if the request fails on our side. When too few are left, a **Buy credits** button appears. See [AI credits](/guides/ai-credits-and-packs/). For a quick reference, see [AI assistant](/docs/ai-assistant) in the docs. To edit on the canvas without AI, see [Edit Mermaid diagrams by dragging, typing, or asking](/guides/edit-mermaid-on-the-canvas/). --- # AI credits: what each action costs, when they reset, and buying more Source: https://flowgraph.studio/guides/ai-credits-and-packs/ Updated: 2026-11-25 How AI credits work in Flowgraph Studio: the price of each AI action, the monthly amount on Pro and Pro Max, carry-over on yearly billing, and credit packs that never expire. Every AI feature in Flowgraph Studio draws on one balance: AI credits. A diagram drawn by AI, a LinkedIn explainer, a Prism explainer and a repository overview all take their price from the same monthly amount. This guide explains what each action costs, when credits come back, what happens to the ones you don't use, and how to buy more. **Plan:** Pro and Pro Max. Pro includes 100 AI credits a month and Pro Max 300. Free has no AI credits, and credit packs can be bought only on Pro and Pro Max. ## What each action costs Each AI button shows its price before you use it, with your balance beside it, so you always know what a click will take. | Action | Credits | | --- | --- | | A new diagram, or a change to the open one, with the AI assistant | 2 | | A LinkedIn explainer | 2 | | An animated explainer (a new diagram with its story, or the story for the open diagram) | 2 | | A Prism explainer | 2 | | Draft questions for a Prism explainer | 2 | | A hand-drawn whiteboard sketch read by AI | 2 | | A repository AI overview or request flow | 5 | Some things cost nothing: - **A fix.** If Mermaid can't read an answer, the app asks the AI to fix it once, for free. - **An explainer's layout suggestion**, before you make the explainer. - **An overview someone already made** of the same commit of a public repository (see [AI architecture overview of a repository](/guides/ai-architecture-overview-of-a-repository/) and [AI request flow](/guides/ai-request-flow-sequence-diagram-from-code/)). If a request fails on our side, its credits are given back. So on Pro, 100 credits are about 50 AI diagrams or explainers a month, or 20 repository overviews, or any mix of the two. Pro Max's 300 are about 150. ## Where to see your balance - **In the AI panels.** Under the prompt, the price and your balance read like "2 credits · 86 of 100 credits left this month". Carried and bought credits are added to that line when you have them. - **In Account.** The **Plan** section has a meter, **AI credits this month**, with the day they reset. Under it are your **Bought credits** and the packs you can buy. ![The Plan section of Account on Pro: the AI credits meter with its reset date, the note that yearly billing carries up to 50 credits, bought credits left, the two credit packs, and one pack bought](/guide-images/account-ai-credits.webp) When your balance is too low for an action, its button is turned off and a **Buy credits** button appears beside it. It opens Account at the credit packs. ## When credits come back Credits reset on the first of each month, at midnight UTC. This is the same on every billing period: monthly, quarterly and yearly plans all get the month's credits each month. A quarterly plan doesn't get three months at once. What happens to the credits you didn't use depends on how you pay: - **Monthly and quarterly billing:** unused credits end at the reset. - **Yearly billing:** unused credits carry into the next month, up to half the monthly amount. That is up to 50 on Pro and up to 150 on Pro Max. Carried credits last one month. They are used first, before the month's own, and any left at the next reset are gone. Only the month's own unused credits carry over, so credits can't pile up from month to month. Account shows what you carried, such as "100 credits this month + 30 carried from November (use by 1 December). Carried credits are used first." ## Buy more with a credit pack If you need more before the reset, buy a credit pack under **Account**: - **100 credits for $6.99** - **300 credits for $17.99** Each pack is a one-time payment, not a subscription. Bought credits: - **Never expire.** They stay until you use them. - **Are used last.** Carried credits go first, then the month's own, then bought ones, the oldest pack first. - **Stay if your plan ends.** They work again when you're back on Pro or Pro Max. AI features need one of those plans, so bought credits can't be spent on Free. ```mermaid flowchart LR action([An AI action]) --> carried["1. Carried credits
yearly billing only"] carried --> month["2. This month's credits"] month --> bought["3. Bought credits
oldest pack first"] ``` Under **Packs bought** in Account, each pack is listed with the day you bought it, its credits, and how many are left. If a pack's payment is refunded, the credits not used yet are taken away, and the list says when it was refunded. Credits have no cash value and can't be moved to another account. ## When you run out An action that costs more than you have left is refused before anything is sent to the AI, with a message that says how many you have and when they reset. On Pro, it also says that Pro Max includes 300 a month. You can: - **Wait for the reset** on the first of the month. - **Buy a credit pack** with **Buy credits**. - **Upgrade to Pro Max** from **Account** or the [pricing page](/pricing) for three times the monthly credits. Nothing else stops working. The editor, Manual mode, exports, imports from repositories without AI, and whiteboards (apart from a sketch read by AI) don't use credits. ## Spend them well - **Change, don't redraw.** Asking the AI assistant to change the open diagram costs the same as a new one, but keeps your layout and ids. Small changes by hand or in Manual mode are free. - **Check the shared overview first.** For a popular public repository, an overview of the same commit may already exist, and then it's free. - **Draft questions once.** Drafting Prism questions costs 2 credits a time. Edit the drafts you get rather than drafting again. For the details of each feature, see [AI credits](/docs/ai-credits) and [AI assistant](/docs/ai-assistant) in the docs, and [Draw and change diagrams with the AI assistant](/guides/ai-assistant-diagrams/). --- # Catch broken connectors and misaligned boxes as you edit Source: https://flowgraph.studio/guides/autocheck-diagram-problems/ Updated: 2026-11-25 Autocheck checks a Mermaid diagram half a second after you stop editing. It flags connections that don't reach their boxes, nodes named only in a connection, overlapping labels, and boxes a few pixels out of line, and it can fix some of them. A diagram can be valid Mermaid and still look wrong. An arrow stops short of its box, a typo in an id creates an extra node, a label hides behind a box, or two boxes in Manual mode sit 3 pixels apart from a straight row. Autocheck looks for these while you work, so you see them before anyone else does. **Plan:** Free, Pro and Pro Max. Autocheck is on by default; turn it off for your account or for one project. ## What it checks Autocheck runs the same rules as **Check diagram** (the clipboard in the top bar), half a second after you stop typing or dragging. It works on flowcharts, state diagrams, ER diagrams, and class diagrams, and it measures the drawing on the canvas as well as the code. - **Errors** are drawings that are plainly broken: a connection whose end stops more than a few pixels from its box, or a connection to something that isn't in the diagram. - **Warnings** are likely mistakes: a node only named in a connection, a connection that runs through another box, labels that overlap each other or a box, boxes that overlap, text that doesn't fit, low contrast, and, in Manual mode, boxes nearly but not exactly in a row or column. - **Suggestions** are about style: long labels, ids shown as labels, the same connection written twice. A typo is the most common cause of a node without a definition. In this diagram `chek` was meant to be `check`, so Mermaid quietly draws a fourth box: ```mermaid flowchart LR order[Order placed] --> check{In stock?} check -->|yes| ship[Ship it] check -->|no| wait[Wait for stock] wait --> chek ``` Autocheck flags `chek` as never defined and asks whether you meant `check`. ## The badge A small badge sits beside the zoom controls. A red cross with a number counts errors, and an amber triangle counts warnings. A green tick means there's nothing to flag. Suggestions aren't counted, so the badge stays quiet about matters of taste. Click the badge to open the list. Click a finding to outline its boxes and connections on the canvas. Where a fix is safe, the finding offers one: - **Line up the row** (or column) moves the boxes that are off so their centres match the one most of them share. - **Reattach automatically** forgets the sides a connection was attached to by hand. - **Put the label back** returns a moved label to its connection. Each fix shows the lines it changes before you apply it, and **Undo** reverses it in one step. **Dismiss** hides a finding you meant, such as a legend that isn't connected to anything. Dismissals are saved in a comment line in the code, so they travel with the diagram. ## Turning it off Autocheck is on by default, on every plan. - **For one project:** open the project, then choose **Autocheck for this project** in its **…** menu. You can also use the switch at the foot of the Check diagram panel. - **For your account:** turn it off in **Account settings**, under **Editor**. Off for the account means off in every project, whatever each project says. - **Signed out:** the switch in the Check diagram panel keeps the setting in this browser. Check diagram still works when Autocheck is off; it runs when you open it. ## Limits The checks look at how a diagram reads, not at whether the design is right. A clean result doesn't mean the diagram is correct, secure, or complete. Sequence diagrams and the other Mermaid types aren't checked yet. --- # Check a diagram for readability before you share it Source: https://flowgraph.studio/guides/check-diagram/ Updated: 2026-11-25 Use Check diagram to find unlabelled decisions, unconnected nodes, duplicate or long labels, overlapping boxes, low contrast and small text, then fix or dismiss each finding. A diagram can be correct and still hard to read: a decision with two unlabelled exits, two boxes both called "Service", white text on a pale fill. **Check diagram** looks for these problems in the open diagram and points at each one on the canvas. This guide lists every check, what it means, and how to fix or dismiss it. **Plan:** Free, Pro and Pro Max. Checks work on flowcharts, state diagrams, ER diagrams and class diagrams. ## Run the check Open a diagram and choose **Check diagram** (the clipboard icon in the editor's top bar). A panel opens beside the canvas with a summary, such as *2 warnings · 1 suggestion*, and a list of findings, warnings first. ![Check diagram beside a flowchart, listing three warnings: two decisions with unlabelled branches and a node that isn’t connected to anything, each with Show and Dismiss](/guide-images/check-diagram.webp) - **Warning**: something that probably makes the diagram harder to read. - **Suggestion**: something worth a look, which may be fine as it is. If the panel says *Not available for this diagram*, either it's another kind of diagram, or its code has an error. Fix the error first; the checks run on what the canvas draws. A clean result shows *Nothing to flag*. That means readable, not right: the checks don't judge whether the design is correct, secure or complete. ## What it checks The checks come in two kinds. Some read the diagram's structure; others measure how it was drawn. | Finding | Kind | What triggers it | | --- | --- | --- | | Unlabelled branches | Warning | A decision (diamond) splits into two or more paths, and some have no label | | Not connected to anything | Warning | A node with no connections, in a diagram that has some | | Separate parts | Suggestion | Groups of nodes that nothing joins together | | Duplicate labels | Warning | Two or more nodes with the same label | | Long label | Suggestion | A label over 50 characters | | Shows its id | Suggestion | A node labelled only with an id such as `A`, `B2` or `N3` | | Overlap | Warning | Two boxes overlap by a tenth of the smaller one or more | | Text doesn't fit | Warning | A label is bigger than its box | | Low contrast | Warning | Text and fill have a contrast below 4.5:1 | | Small text | Suggestion | Labels drawn smaller than 12px | A few details make the results fairer: - Labels are compared as plain words, so icons, rich-node markup and line breaks don't count. - A node inside a group (a subgraph or composite state) that has connections counts as connected. - The start and end points of a state diagram aren't treated as nodes. ## Find it on the canvas Choose **Show** on a finding to outline the nodes and connections it's about. For *Separate parts*, the smaller parts are the ones highlighted. Choose **Show** again, or close the panel, to clear the outline. ## Fix a finding Most fixes are a change to the code, and the finding says what to do: label each branch (for example *Yes* and *No*), give a node a label that says what happens there, shorten a label and move the detail into a subtitle or a note, or change the colours in **Style**. ```mermaid flowchart LR A[Receive order] --> B{In stock?} B -->|Yes| C[Ship] B -->|No| D[Back-order] ``` Here the decision's branches are labelled, and every node says what it does, so this diagram passes both checks that a version with `B --> C` and `B --> D` would fail. Two findings offer a fix you can apply in one step: - **Overlap**, when the diagram has positions you set by hand: **Switch to automatic layout** removes the saved positions, so every node is placed again. - **Text doesn't fit**, when the node was given a size: **Let the box fit its text** removes that size, so the box grows to its label again. Choosing the fix shows a preview first: the lines of code it removes and adds. **Apply** makes the change, and a bar at the top of the panel says *Applied* with an **Undo** button. Undo works until the diagram changes again; after that, use Undo in the editor. ## Dismiss what you meant Some findings are deliberate. A legend has no connections; a side-by-side comparison has two separate parts. Choose **Dismiss** to hide a finding for this diagram. Dismissals are kept in the diagram's code, in one comment line: ``` %% flowgraph-checks: {"v":1,"dismissed":["isolated-node:legend"]} ``` Other Mermaid tools ignore that line, so it travels with the diagram (in exports, in the API, in a repository) without changing the drawing. **Show dismissed** at the bottom of the panel lists them, and **Restore** brings one back. ## Make it part of your review Checking takes seconds, so it's worth doing every time a diagram is about to be seen by others: 1. Before you **share a link** or export for a document. 2. Before you choose **Mark as reviewed** in a diagram's review status. See [owners and review status](/guides/keep-architecture-diagrams-up-to-date/). 3. After a big change from AI or an import, which can add long or duplicate labels. To check Mermaid in a pipeline instead, see [validate Mermaid diagrams in CI](/guides/validate-mermaid-diagrams-ci/). For keeping a whole set of diagrams readable, see [organise a large set of diagrams](/guides/organize-large-diagram-sets/). The feature is also described in the [docs](/docs/accounts-and-saving#check-diagram). --- # Set up a brand kit for your LinkedIn explainers Source: https://flowgraph.studio/guides/explainer-brand-kit/ Updated: 2026-11-25 Save your colours, font, logo, name, handle and photo as a brand kit, apply it to any LinkedIn explainer in one click, and keep several kits for different brands on Pro Max. If you post explainers often, the styling decisions repeat: the same colours, the same logo in the corner, the same name in the footer. A brand kit saves them once. Apply it and the explainer switches to a fifth look, **Brand**, built from your kit, with your footer filled in. **Plan:** Pro keeps 1 brand kit and Pro Max 5. Kits are saved in your account, so they're on every device you sign in on. On Free, the **Brand kit** section shows **Brand kits come with Pro**. ## What a kit holds Open a LinkedIn explainer (in **Projects**, **New LinkedIn explainer**, or any explainer you've made). The **Brand kit** section is in the panel on the left, under **Content**. Choose **Make a brand kit** for your first one. | Field | What it's for | | --- | --- | | **Kit name** | How the kit is listed, such as "Acme" or "Personal" | | **Name on slides** | The name in the footer | | **Handle or link** | The handle or address in the footer, such as linkedin.com/in/your-name | | **Colours (the first is the main one)** | One to five colours | | **Font** | Sans serif, Serif or Monospace | | **Photo** | The round picture in the footer | | **Logo (top right of every slide)** | Your logo, on the infographic and every slide | A first kit starts from what the explainer already shows: your name, handle and photo. ### Colours The first colour is the main one: it tints the cards, sets the title and the takeaway band, and leads the accents. The others are used for accents in order. Choose **Colour** to add one, up to five, and the **×** beside one to remove it. If you've saved diagram styles, **Use the colours of a saved style…** fills the colours from one of them, so your explainers match your diagrams. Any colours work. The Brand look sits on a white background, and every text colour is adjusted until it reads at a contrast of at least 4.5 to 1 on what it sits on. A pale yellow brand colour won't give you pale yellow text. ### Photo and logo Choose **Upload** for each and pick a PNG, JPEG or WebP file (up to 50 uploads a day). - **The photo** is cropped to a square from its centre and saved small, for the round footer picture. - **The logo** is scaled to fit and saved as a PNG. A wide logo works best. - Both are re-encoded in your browser before upload, which also removes their metadata, such as where a photo was taken. **Remove** clears either one. ## Apply a kit Choose **Save and apply** when you make or edit a kit, or **Apply** beside a saved one. Three things happen: 1. The **Style** switches to **Brand**, a fifth choice beside Clean light, Bold dark, Gradient and Whiteboard. 2. The logo appears in the top right, and the font and colours change. 3. **Your branding** takes the kit's name, handle and photo for the footer. ![A LinkedIn explainer with a brand kit applied: the kit shown as Applied in the left panel, and the infographic in the kit’s colours with the name and handle in the footer](/guide-images/explainer-brand-kit.webp) The applied kit is marked **Applied**. You can still switch the style back to one of the four looks; **Brand** stays in the list for this explainer. ```mermaid flowchart LR kit[Brand kit:
colours, font, logo,
name, handle, photo] -->|Apply| exp[This explainer] exp --> look[Brand look] exp --> foot[Footer: name,
handle, photo] look --> out[PNG, carousel PDF,
PowerPoint, Share] foot --> out ``` Every export carries it: **PNG**, **Copy image**, the **Carousel PDF**, **PowerPoint**, and the page you publish with **Share**. ## Edit, switch and delete kits - **Edit**: the pencil beside a kit opens it again. **Save and apply** saves it and applies it to the explainer you have open. - **Switch**: choose **Apply** on another kit. Agencies and people who post for more than one company can keep a kit for each on Pro Max. - **Delete**: the bin beside a kit. Explainers that use it keep their look. Applying a kit copies its colours, font and logo into that explainer. Editing the kit later changes the explainers you apply it to from then on, not the ones already made. To update an older explainer, open it and apply the kit again. When you reach your plan's number of kits, the section says *Your plan keeps 1 brand kit.* On Pro, it offers **Pro Max keeps 5**. Delete a kit to make room, or upgrade. ## What a kit doesn't change - **The words and the layout.** A kit is styling only; the content stays yours to edit. - **Prism explainers and walkthrough carousels.** They use the four built-in looks. Walkthroughs do use the footer name and handle from **Your branding**. - **Your diagrams.** Diagram styles are set in the editor's style panel. ## A kit that works in the feed - **One main colour with strong contrast** reads best at feed size. Keep the second colour for one role. - **A simple logo.** It's small in the corner; detail disappears. - **Check the first post closely.** A kit repeats a mistake as easily as a good choice. For a whole carousel built around a kit, see [build a consistent technical carousel with a reusable brand kit](/guides/branded-technical-carousel/). For making the explainer itself, see [how to turn a LinkedIn post into an infographic](/guides/linkedin-post-to-infographic/) and [LinkedIn explainers in the docs](/docs/linkedin-explainers). --- # Repositories on the Free plan: 3 repositories and 50 refreshes a month Source: https://flowgraph.studio/guides/free-plan-repository-limits/ Updated: 2026-11-25 How the Free plan's limits on diagrams from repositories work, what counts as a repository and as a refresh, how to make room for another one, and what Pro changes. Flowgraph Studio can draw a repository's services, CI pipeline, data model and packages from its own files, on every plan and without AI. On Free, that comes with two limits: diagrams from 3 repositories in all, and 50 refreshes a month. This guide explains what each one counts, how to see where you are, and how to make room when you need another repository. **Plan:** Free, Pro and Pro Max. Free adds diagrams from 3 public repositories in all and refreshes them 50 times a month. Pro and Pro Max have no limit on either, and add private repositories. ## The two limits | | Free | Pro and Pro Max | | --- | --- | --- | | Repositories diagrams can come from | 3 in all | No limit | | Refreshes from a repository | 50 a month | No limit | | Private repositories | No | Yes | The repository limit is **in all, not a month**. Once diagrams from three repositories are in your account, a fourth needs a free place first (see below). The refresh limit is **a month**: it resets on the first of each month. Diagrams from repositories also count toward your other Free limits, like any diagram: 25 diagrams in 3 projects. An import goes into a new project named after the repository when you have room for one, and into the open project when you don't. ## What counts as a repository A repository takes a place the first time you add diagrams from it. After that: - **More diagrams from it are always fine.** Add the services diagram today and the data model next week; it's still one repository. - **Folders count as the same repository.** Scanning `github.com/owner/shop/tree/main/api` and then `.../tree/main/web` uses one place. - **Each host and name is its own repository.** `github.com/owner/shop` and `gitlab.com/owner/shop` are two. Some things don't count at all: - **Scanning.** You can scan any public repository, signed in or not, and see what it would draw. Only adding the diagrams to your account takes a place. - **Opening an existing diagram**, editing it, styling it, exporting it or sharing it. ## What counts as a refresh A diagram made from a repository has a **From GitHub** button in the editor's top bar (or **From GitLab**, **From Bitbucket**, **From Azure DevOps**). In it, **Refresh from GitHub** reads the branch's latest commit and draws the diagram again, so you can see what changed and choose **Replace this diagram** or **Add as a new diagram**. Each time you start a refresh, it counts as one, even when the diagram turns out to be up to date. Refreshing needs an account, because the count is kept by the server. ## See where you are - **In the import dialog.** Signed in on Free, **Import repository** shows a line like "Free plan: 2 of 3 repositories, 14 of 50 refreshes this month." - **In Account.** The **Plan** section has two meters: **Repositories imported from**, and **Refreshes this month** with the day they reset. ![The Plan section of Account on Free: repositories imported from, 1 of 3, and refreshes this month, 0 of 50, with the note that deleting every diagram from a repository frees its place once a month](/guide-images/account-free-repositories.webp) ## When you reach a limit **A fourth repository.** Adding its diagrams is refused, with a message that says why. To make room, delete every diagram from one of your three repositories. The next time you add diagrams from a new repository, that empty place is given to it. A few rules keep this fair: - **Once a month.** One place can be freed this way each calendar month. If you've already freed one this month, wait for the next, or upgrade. - **Not straight away.** A repository you imported in the last hour keeps its place, since its diagrams may still be saving to your account. - **Every diagram.** If even one diagram from that repository is left, its place stays. ```mermaid flowchart TD add([Add diagrams from a new repository]) --> room{Fewer than 3
repositories?} room -->|yes| ok[Diagrams added] room -->|no| empty{One of them has
no diagrams left?} empty -->|no| refuse[Refused: delete every
diagram from one] empty -->|yes| month{Already freed one
this month?} month -->|no| ok month -->|yes| wait[Refused: next month,
or upgrade] ``` **The 51st refresh.** It's refused until the first of next month, and the message says the day. Your diagrams stay as they are, and you can still edit them by hand. ## Moving between plans - **Upgrading** lifts both limits at once. Pro and Pro Max also read private repositories and can make [AI overviews](/docs/repositories#ai-architecture-overview) of a repository. - **Going back to Free** keeps every diagram you made. If they come from more than three repositories, you can still open, edit and refresh them, within 50 refreshes a month, but a new repository needs a freed place, as above. Flowgraph keeps only each repository's name and when its place was taken, never its files or contents. ## Choose your three well - **Scan first.** The scan is free and needs no account, so look at what a repository draws before you add anything. - **Scan a folder** of a large repository to get the part you care about. - **Refresh when it matters,** such as before a review or a release, rather than after every commit. For the import itself, see [Draw a GitHub repository's architecture from its own files](/guides/visualize-a-github-repository/), and the guides for [GitLab](/guides/visualize-a-gitlab-repository/), [Bitbucket](/guides/visualize-a-bitbucket-repository/) and [Azure DevOps](/guides/visualize-an-azure-devops-repository/). --- # Make a Prism explainer from a web page or a pasted text, with its sources Source: https://flowgraph.studio/guides/prism-from-a-web-page/ Updated: 2026-11-25 Read an article into a Prism explainer, trim it, and check the passages it quotes word for word, so every part of the explanation points back to what the page actually says. A Prism explainer made from a concept is explained from general knowledge. One made from a text is different: it explains only what that text says, and it quotes the passages it relies on. This guide covers the second kind, from reading a web page to checking each quote before you share the result. **Plan:** Pro and Pro Max. Reading a page costs nothing; making the explainer uses 2 AI credits. Pro includes 100 credits a month and Pro Max 300, shared by every AI feature. ## Read the page into the text box In **Projects**, choose **New Prism explainer**. Under **Explain**, choose **A pasted text**. A field appears above the text box: **Or read a web page: https://…**. Paste the page's address and choose **Read page**. ```mermaid flowchart LR url[Page address] --> read[Read page] read --> box[Text box:
check and trim] box --> make[Create explainer] make --> check[Check the sources] ``` Flowgraph Studio fetches the page for you, so the site sees Flowgraph Studio, not you. It keeps the reading text and leaves out what isn't the article: - **Menus, headers, footers, side panels, forms, buttons and figures** are dropped. - When the page marks its **article** (or its main content), only the largest one is kept. - Paragraphs stay apart, so the text is easy to scan. The text lands in the box with a note: *Read "Page title (site)"*, with the page's own title. Under the field, **From** links to the page. If the text you end up explaining isn't from that page, choose the **×** beside it (**Not from this page**), and the explainer won't name it. Reading a page doesn't make an explainer, so it doesn't use credits. ## Pages it can't read Some pages can't be read this way. The message says why, and the answer is almost always the same: copy the text from the page and paste it into the box instead. | What you see | Why | | --- | --- | | The site doesn't allow its pages to be read automatically | The site refused (for example, it blocks automated visits) | | Too little readable text | The page needs sign-in, sits behind a paywall, or is drawn by scripts | | That address isn't a web page | It's a PDF or another file | | Too large to read | The page is over 2 MB | | Didn't answer in time | The site took more than 10 seconds or couldn't be reached | Only public web pages on the usual ports can be read: not IP addresses, local or internal names, addresses with a user name or password, or pages on Flowgraph Studio itself. ## Check and trim the text The box holds 200 to 20,000 characters. A long article is cut at the end of a paragraph near 20,000 characters, and the note says so. Before you make the explainer: - **Remove what isn't the article**: a newsletter sign-up, a list of related stories, comments. - **Cut to the part you want explained.** One section explained well beats a whole report explained thinly. - **Keep the sentences you'll want quoted.** The explainer can only cite what's in the box. Then choose **For** (General audience, Beginners or Experts) and **Shape** (or **Choose for me**), and **Create explainer**. ## How the sources work Each part of the explanation that states a fact, a figure or a relationship from the text lists the passages that support it. The passages appear under **Sources** in the panel, numbered, and the numbers appear in the explainer next to the parts they support. The quotes are checked against your text: - A quote must appear in the text **word for word**. Differences in spacing, capitals and punctuation are ignored; different words aren't. - If the AI quotes something that isn't in the text, it's asked once to fix it. - Any quote still not found is **dropped, with its citations**, so nothing is shown as cited that the text doesn't say. An explainer can cite up to 8 passages, each a sentence or part of one. Made from a page, it names the page and the date it was read at the bottom, for example "Heat pumps explained (example.org), read 18 Nov 2026", with a link under **Sources**. ## Check it before you share it The quote check proves a passage is in the text. It doesn't prove the passage supports the part it's attached to. That part is yours: 1. **Read each numbered part with its quotes.** In the panel, a part with sources says *Cites source 1, 3*. Does the quote say what the part claims? 2. **Watch your own edits.** If you change what a cited part says, the note under it reminds you to check the source still supports it. 3. **Remove a weak source.** The **×** beside a source removes it and its citations everywhere. 4. **Use Keep in mind** for limits the reader should know, such as "Figures from the 2025 report; check for newer data." Making the explainer again (**Make it again**) uses another 2 credits and replaces your edits. The version before it stays in version history. ## When to explain a text, not a concept | Use a pasted text or a page when… | Use a concept when… | | --- | --- | | Accuracy matters: a policy, a report, a release note | You want the general idea, such as how DNS works | | Readers will ask "where does it say that?" | Nobody needs a citation | | The facts are current or specific to one company | The subject is stable and well known | For the rest of the editor (shapes, layout, words and downloads), see [how to explain any concept visually with Prism explainers](/guides/prism-visual-explainer/) and the [Prism section of the docs](/docs/prism-explainers). To share the result as a page readers can explore, see [share a Prism explainer as an interactive page](/guides/prism-interactive-pages/). --- # Share a Prism explainer as an interactive page readers can explore Source: https://flowgraph.studio/guides/prism-interactive-pages/ Updated: 2026-11-25 Download a Prism explainer as one self-contained web page, or publish it as a link, where readers click a part to read about it and its sources, or step through the parts in order. A picture of an explainer shows everything at once. An interactive page lets the reader take it one part at a time: click the compressor, read what it does and the passage it rests on, then move on. Flowgraph Studio makes that page from any Prism explainer, as a file you download or as a link you publish. **Plan:** Pro or Pro Max. The **Interactive** download, like the PNG, SVG and PDF downloads, comes with both, and publishing it as a link with **Share** uses their hosted links. On Free you can open and edit the Prism samples in Templates; the download buttons show the plans. ## What the reader gets The page shows the explainer as you drew it, with a panel beside it (below it on a phone): - **The title and overview**, then **‹ Previous**, **Next ›** and **Show all**, with a count such as *2 of 5*. - **A detail box** for the chosen part: its name, what it does, its date on a timeline, and the passages it cites, quoted with their numbers. - **A numbered list of the parts.** Clicking one is the same as clicking it in the picture. - **The takeaway**, the **Keep in mind** note, and, when it was made from a web page, a link to that page. ```mermaid stateDiagram-v2 state "All parts shown" as All state "One part in focus" as One [*] --> All All --> One: click a part, or Next One --> One: Previous, Next, arrow keys One --> All: Show all, or Escape ``` When a part is chosen, it's outlined and the rest of the picture fades, so the reader sees where it sits. The arrow keys step through the parts and **Escape** shows them all again. A comparison works the same way, row by row: each row's detail lists every option's value for that criterion. ## Download it as a file In the Prism editor's top bar, choose **Interactive**. You get one HTML file named after the explainer. - **It loads nothing from the internet.** The picture, the text and the script are all inside the file, so it opens offline. - **Send it anywhere**: attach it to an email, add it to a learning platform, or put it on any website. - **It's a copy.** Later edits to the explainer don't change a file you already sent; download it again. The other downloads in the top bar are still there for slides and documents: **PNG** (at twice the page size), **SVG**, and a one-page **PDF**. All four follow the **Format** you chose under **Page**: Landscape (16:9), Portrait (4:5) or Square. ## Publish it as a link Choose **Share** in the top bar. The dialog, **Share the explainer**, publishes the same page on flowgraph.studio. First choose who can see it: | Choice | Who can open it | | --- | --- | | **Anyone with the link** | Anyone you send it to. Not listed or indexed. Can be embedded on any site. | | **Everyone** | Anyone. Public, and may appear in search results. | | **Invited people** | Only people you invite, after signing in. Can't be embedded on other sites. | Then choose **Create link**. The dialog gives you: - **Link**, to send. It opens the page full size, with a note to click a part or step through them. - **Embed**, an ` ``` Copy the real snippets from the Share panel; they carry your link's address and the right sandbox settings. ## Choose who can see it | Access | Who can open it | Can it be embedded? | | --- | --- | --- | | **Anyone with the link** | Anyone who has the address; not indexed by search engines | Yes | | **Everyone** | Public; may appear in search results | Yes | | **Invited people** | Only people you invite by email, after they sign in with that address | No | Invited links add **comments**: you and the people you invited can comment beside the diagram, pin a comment to a node or a spot, reply, and resolve threads. You get at most one email an hour about new comments, and the editor's **Comments** button shows them next to the node each one is about. ```mermaid sequenceDiagram actor O as Owner participant F as Flowgraph Studio actor R as Reviewer O->>F: Share with invited people F-->>R: Email with the link R->>F: Sign in with that address R->>F: Comment on the API node F-->>O: One email an hour, at most O->>F: Fix the diagram, Update link R->>F: Resolve the thread ``` ## Share more than diagrams: pages Three other things can be published the same way, with the same access choices, as a page to explore or step through: - **Prism explainers**: readers click a part to read about it and the passages it cites. See [Prism explainers](/guides/prism-visual-explainer/). - **LinkedIn explainers**: the infographic, and the carousel to step through or swipe on a phone. - **Walkthrough carousels**: a flowchart explained one step per slide. See [explaining a flowchart step by step](/guides/explain-a-flowchart-step-by-step/). Use **Share** in each one's editor. Pages have an **Embed** snippet instead of image snippets, and no comments. They run in a sandbox that allows only their own script and loads nothing from anywhere else, so an embedded page can't reach your site's cookies. ## Whiteboards are shared differently A whiteboard is shared for working together rather than publishing: **Share** invites people as *Can edit* or *Can view* to work on it live, and a **view-only link** lets anyone watch without an account for 1, 7, or 30 days. See [running a review on a shared whiteboard](/guides/whiteboard-architecture-review/). ## Good habits - **Embed the link, not a screenshot**, anywhere the diagram might change. - **Use "Anyone with the link" for internal wikis**: it isn't indexed, and it embeds. - **Use "Invited people" for drafts under review**, and resolve the comment threads before you make it public. - **Turn off links you no longer need.** Account settings shows them all in one place. Need the image in a build pipeline instead of a page? [Render diagrams in CI with the API](/guides/render-mermaid-in-ci-with-api/). --- # Convert SQL to an ER diagram without hiding schema assumptions Source: https://flowgraph.studio/guides/sql-to-er-diagram/ Updated: 2026-11-23 Turn SQL table definitions into a Mermaid ER diagram, then verify foreign keys, nullability, and omitted statements before using it in documentation. To convert SQL into a useful ER diagram, import table definitions, inspect the relationships, and compare the result with the source. Automatic conversion saves transcription time. The review is what makes the picture dependable. Use a schema-only file when possible. A data dump adds noise and can include personal or confidential records that are unnecessary for understanding table structure. ## Start with explicit constraints This small schema describes customers and orders: ```sql CREATE TABLE customers ( id INTEGER PRIMARY KEY, email TEXT NOT NULL UNIQUE ); CREATE TABLE orders ( id INTEGER PRIMARY KEY, customer_id INTEGER NOT NULL REFERENCES customers(id), status TEXT NOT NULL ); ``` The important relationship is declared through `REFERENCES`, not inferred from the column name. A field named `customer_id` without a constraint might be a relationship, but a converter should not silently treat the naming convention as proof. For this simplified model, the relationship can be explained as: ```mermaid erDiagram CUSTOMERS ||--o{ ORDERS : places CUSTOMERS { int id PK string email UK } ORDERS { int id PK int customer_id FK string status } ``` This is an illustrative rendering: an importer may name entities and label relationships differently (Flowgraph Studio, for example, keeps table names as written and replaces characters Mermaid can't use with underscores). Read the resulting code before making it the team's reference. ## Import and inspect in Flowgraph Studio Open [Flowgraph Studio](/projects), choose **New diagram → Start from → From a SQL schema**, and paste the DDL or drop a `.sql` file. The schema is read in your browser and nothing is uploaded. PostgreSQL works best, including `pg_dump --schema-only` output; common MySQL table syntax mostly works too. The importer reads `CREATE TABLE` (columns, `NOT NULL`, primary keys, `UNIQUE`, `REFERENCES`, and table constraints), unique indexes on plain columns, and the changes migrations make: `ALTER TABLE` adding, dropping, renaming, or retyping columns, adding and dropping constraints, renaming tables, and `DROP TABLE`. Statements apply in order, so a file of migrations gives the schema as it is at the end. Every other statement is skipped and listed with its line number, so one unfamiliar statement doesn't spoil the rest; if a skipped statement changes tables, the import says the diagram may be out of date. To draw a repository's data model from a whole folder of migrations, use [Import from GitHub](/guides/visualize-a-github-repository/). Read those reports. A schema containing functions, permission statements, vendor-specific constructs, or generated tables may not map completely to the diagram. SQL import is a documentation conversion, not execution of the SQL and not validation of an entire database dump. Compare the number of expected tables with the rendered entities. Then inspect one relationship at a time: referenced table, referenced column, foreign-key field, and whether nullability permits the relationship to be absent. Composite keys deserve particular attention because several columns may define one relationship. ## Add the information DDL cannot explain The source may tell you that `customer_id` is required. It probably does not tell you why anonymous purchases are prohibited or whether a deleted customer is anonymized instead of removed. Add a short accompanying note with those rules. Keep implementation facts separate from intended future changes. If the diagram represents a proposed migration, label it as a proposal rather than current production state. ## Save a reproducible result Keep the relevant schema or migration reference beside the exported Mermaid source. Include a review date and an owner. Regenerate after changes to tables, keys, or nullability; do not update only the picture while leaving the source behind. Use the [official Mermaid ER reference](https://mermaid.js.org/syntax/entityRelationshipDiagram.html) to check notation, and the [Flowgraph documentation](/docs) for editing and export options. The final deliverable should let a colleague trace a line in the diagram back to a real constraint or an explicitly documented assumption. --- # Validate Mermaid diagrams in CI before documentation ships Source: https://flowgraph.studio/guides/validate-mermaid-diagrams-ci/ Updated: 2026-11-30 Check Mermaid files and Markdown diagrams in CI with Flowgraph's CLI. Report syntax failures while keeping quotas, secrets, and fork behavior explicit. A broken diagram often reaches documentation because nobody opens that page during code review. A CI validation step can catch Mermaid that no longer renders before the documentation is released. Validation proves that the renderer accepts the source. It does not prove that the architecture, cardinality, or business process is correct. Keep semantic review alongside the automated check. ## Start with a local check Create an API key in Flowgraph Studio under **Account settings → Render API** (a free account works), set it as `FLOWGRAPH_API_KEY`, and run: ```bash npx flowgraph-cli check docs ``` [`flowgraph-cli`](https://www.npmjs.com/package/flowgraph-cli) is a small MIT-licensed package with no dependencies; it needs Node 20 or later. It reads `.mmd` and `.mermaid` files and every Mermaid block in Markdown files under the folders you name, and prints each failing file with the line of the error. Exit code `0` means every diagram passed, `1` means one or more failed, and `2` means a usage or setup error, such as a missing key. You can also pass a quoted glob, such as `"docs/**/*.md"`; globs need Node 22 or later. `npx flowgraph-cli render docs --out-dir build/diagrams --theme theme.json` writes the images as well. ## Add a workflow Pin the CLI version in CI so a new release can't change the check under you. ```yaml name: Check diagrams on: [push, pull_request] permissions: contents: read jobs: diagrams: runs-on: ubuntu-latest steps: - uses: actions/checkout@v7 - uses: actions/setup-node@v7 with: node-version: 24 package-manager-cache: false - run: npx --yes flowgraph-cli@0.3.0 check docs --concurrency 2 env: FLOWGRAPH_API_KEY: ${{ secrets.FLOWGRAPH_API_KEY }} ``` The action references follow the current [setup-node examples](https://github.com/actions/setup-node); check them again when adopting the workflow. If you'd rather not install anything, the [render API guide for CI](/guides/render-mermaid-in-ci-with-api/) does the same check with `curl` against `/v1/validate`. ## Plan for secrets and quotas Store the API key in repository or organization secrets. Pull requests from forks may not receive those secrets. Define whether such checks run later in a trusted context or use another validation path; do not expose a key to untrusted code to make the check pass. Each diagram that passes uses one render from the monthly allowance (50 on Free, 5,000 on Pro, 20,000 on Pro Max); diagrams that fail aren't counted. Rechecking a large documentation tree on every commit can use a Free allowance quickly. Run the check only when Markdown or `.mmd` files change (a `paths` filter on the workflow trigger), or schedule a full check, and keep concurrency low: each key can send 30 requests a minute. ## Make failure actionable Keep CLI output in the job log and ask reviewers to fix the named source file. A green check should complement a readable preview, not replace it. Use the [flowchart cheat sheet](/guides/mermaid-flowchart-cheat-sheet/) for common syntax fixes and the [API reference](/api-docs) for limits and responses. ## Draw diagrams from the code From version 0.2.0, `flowgraph-cli code` draws the diagrams that the app's repository import draws **From the code**, from the checkout itself: a codebase map, module dependencies, the route map, class diagrams, call maps and function flowcharts. TypeScript, JavaScript, Python, Java, Go and C# are parsed, and the codebase map covers every file. It needs no API key and sends nothing anywhere: the parser and its grammars are part of the package, so the code stays on the runner. The same commit always gives the same Mermaid, so a diagram committed beside the code only changes when the code does. This job draws the module dependencies and the route map again, and fails when the diagrams committed in `docs/diagrams` no longer match the code: ```yaml name: Diagrams from the code on: push: branches: [main] pull_request: permissions: contents: read jobs: diagrams: runs-on: ubuntu-latest steps: - uses: actions/checkout@v7 - uses: actions/setup-node@v7 with: node-version: 24 package-manager-cache: false - run: npx --yes flowgraph-cli@0.3.0 code deps --out docs/diagrams/dependencies.mmd - run: npx --yes flowgraph-cli@0.3.0 code routes --folder services/api --out docs/diagrams/routes.mmd - run: git diff --exit-code docs/diagrams ``` Because no key is involved, this also runs on pull requests from forks. `--format md` writes a Markdown page with the diagram and the notes on what it left out, which GitHub and GitLab show as a diagram. To publish images instead, add `--format svg` (or `png`) with an API key: only the Mermaid text goes to the API, never the code, and each image uses one render. Run `npx flowgraph-cli --help` for every option. To have the diagrams redrawn and committed into your README on every push, instead of failing the build when they drift, use `flowgraph sync`: see [Keep README architecture diagrams up to date in CI](/guides/keep-readme-diagrams-up-to-date-in-ci/). --- # How to run an architecture review on a shared whiteboard Source: https://flowgraph.studio/guides/whiteboard-architecture-review/ Updated: 2026-11-19 Run a design review on a live whiteboard from start to finish: an agenda, private brainstorming, dot voting, decision cards and action items, then turn the board into a Mermaid diagram and a written record. Architecture reviews go wrong in familiar ways: the loudest idea wins, decisions live in someone's memory, and the diagram on the board never makes it into the docs. A shared whiteboard with a little structure fixes all three. This guide walks through a one-hour review on a Flowgraph Studio whiteboard, from an empty board to a diagram and a decision record. ## The shape of the session ```mermaid flowchart LR prep[Prepare the board] --> ideas[Private round:
everyone adds notes] ideas --> vote[Dot vote on
the options] vote --> decide[Decision cards and
action items] decide --> out[Diagram, summary,
design document] ``` Each step uses one feature, and nothing has to be copied by hand afterwards. ## 1. Prepare the board In **Projects**, choose **New whiteboard** and start from the **Architecture review** template. It lays out named frames: Goal, Current design, Constraints, Risks, Alternatives, Decision, Actions, and a Parking lot, each with a note on what goes in it. (The other templates are design critique, technical brainstorming, and option comparison, all on the [Templates](/templates) page too.) ![A new whiteboard from the Architecture review template, with frames for the goal, current design, constraints, risks, alternatives, decision, actions and a parking lot](/guide-images/whiteboard-architecture-review.webp) Before the meeting: - **Add the current design.** **Add diagram** places one of your diagrams on the board as a snapshot. Choose **Editable shapes** instead to get boxes and arrows you can annotate and rearrange. - **Add the material.** Paste screenshots, or use **Add PDF pages** to place up to 20 pages of a document as images to mark up. - **Set the agenda.** Put the frames in order; you'll present them one by one. - **Share it.** **Share** invites people by email as *Can edit* or *Can view*. For a wider audience, a **view-only link** lets anyone watch the board live without an account, for 1, 7, or 30 days. ## 2. Collect ideas without anchoring Start a **private round** on the Alternatives frame. While it runs, the notes each person adds are visible only to them; when time is up, you reveal everyone's at once. Nobody gets anchored by the first idea on the board. Run a shared **timer** everyone sees, and use **Present** to walk through the agenda frames; others can choose **Follow along** to see each one in turn. For bigger groups, **breakouts** send each group to its own frame and **Bring everyone back** gathers them again. ## 3. Converge with a dot vote Select the options and start a **dot vote**. While it's open, each person sees only their own dots and how many people have voted, so early votes don't sway the rest. When you close it, everyone sees the totals and who voted for what. Votes aren't anonymous, which keeps the discussion honest. ## 4. Record the decision where everyone can see it **Facilitate** adds two kinds of cards to the board: - **Decision cards**: the question, the decision, why, the trade-offs, an owner, a date, and a status (proposed, accepted, rejected, or superseded). - **Action items**: the task, an owner, a due date, and a status. A decision record usually ends up looking like this: ```mermaid flowchart TB Q{{"Queue or direct calls
between checkout and fulfilment?"}} Q -->|chosen| A["Use a queue
absorbs sale spikes"] Q -.->|rejected| B["Direct HTTP calls
simpler, but couples uptime"] A --> T1[Load-test the queue
owner: Sam, due Friday] A --> T2[Add a dead-letter queue
owner: Priya] ``` Comments with **@mentions** and quick reactions keep side discussions on the board instead of in chat. **Activity** shows who added, edited, or deleted what during the session. ## 5. Turn the board into lasting artifacts The whiteboard is the working surface; three outputs make the result last: - **A real diagram.** **Convert to diagram** makes an editable flowchart from the whole board, one frame, or a selection: shapes and sticky notes with text become nodes, attached arrows become connections, and frames become groups. You see what was left out, and the Mermaid code, before saving. For a hand-drawn sketch, Pro's **Read with AI** writes the flowchart from a picture of it. - **A session summary.** Download the agenda, decisions, actions, vote results, and open comment threads as Markdown, or the **board as a PDF** with one page per frame. Decisions also download as Markdown and actions as CSV for your tracker. - **A design document.** In a [design document](/guides/design-document-from-diagrams/), **Add decisions and actions from a whiteboard** brings the board's decision cards and action items into the Decisions and Next actions sections. ## Tips for a good review - **Send the board a day ahead** with the current design on it. Reviews go faster when people arrive with questions. - **Write the decision as a sentence**, not a box label: "Use a queue between checkout and fulfilment" is a decision; "Queue" is not. - **Give every action an owner and a date**, or it isn't an action. - **Keep the parking lot.** Good ideas outside the agenda deserve a place that isn't the meeting. Whiteboards are in beta and free on every plan; live sessions hold up to 10 people at once. Once the decision is in a diagram, [keep it up to date with version history and reviews](/guides/keep-architecture-diagrams-up-to-date/). --- # How to draw an AWS architecture diagram with Mermaid Source: https://flowgraph.studio/guides/aws-architecture-diagram-mermaid/ Updated: 2026-11-19 A step-by-step way to diagram an AWS system as code: list the components, group them by boundary, label the connections, then add official AWS icons and a clean layout. Architecture diagrams go stale because they live in a slide or a drawing tool nobody opens. Writing them in Mermaid keeps them next to the code, in a format you can review in a pull request. This guide builds a serverless order system step by step, then makes it presentation-ready with official AWS icons. ## 1. List the components Start with the pieces, not the boxes. For a typical serverless shop: - **Customers** using the web and mobile apps - **CloudFront** in front, for caching and TLS - **Cognito** for sign-in - **API Gateway** receiving requests - **Lambda** functions for orders and fulfilment - **SQS** between them, so a slow step doesn't block checkout - **DynamoDB** for orders, **S3** for receipts ## 2. Connect them in plain Mermaid Write the request path first, left to right, and label each connection with what travels on it. Labels are the part people read most. ```mermaid flowchart LR users([Customers]) -->|HTTPS| cdn[CloudFront] users -.->|sign in| auth[Cognito] cdn --> api[API Gateway] api --> orders[Orders Lambda] orders --> table[(Orders table)] orders -->|OrderCreated| queue[Order queue] queue --> worker[Fulfilment Lambda] worker --> bucket[(Receipts bucket)] ``` That is already a useful diagram, and it is twelve lines of text. ## 3. Group by boundary Put what runs inside your AWS account in a subgraph. Use subgraphs for whatever boundary matters to the reader: an account, a region, a VPC, or a team. ```mermaid flowchart LR users([Customers]) -->|HTTPS| cdn[CloudFront] users -.->|sign in| auth[Cognito] subgraph region [AWS eu-west-1] api[API Gateway] --> orders[Orders Lambda] orders --> table[(Orders table)] orders -->|OrderCreated| queue[Order queue] queue --> worker[Fulfilment Lambda] worker --> bucket[(Receipts bucket)] end cdn --> api ``` ## 4. Add official AWS icons Icons make an architecture diagram readable at a glance. In Flowgraph Studio, a node label can start with an icon and carry a subtitle, badges and a status light: ```text API["@icon:aws:lambda **Orders API** | sub:Python 3.12 | badge:256MB:emerald | status:healthy"] ``` The same diagram with icons, drawn top to bottom so it fits a page: ```mermaid flowchart TB USERS(["@icon:lucide:users **Customers** | sub:Web and mobile"]) CDN["@icon:aws:cloudfront **CloudFront** | sub:CDN and TLS"] AUTH["@icon:aws:cognito **Cognito** | sub:Sign-in"] subgraph REGION["@icon:logos:aws **AWS** | sub:eu-west-1"] API["@icon:aws:api-gateway **API Gateway** | sub:REST API"] ORDERS["@icon:aws:lambda **Orders** | sub:Lambda | status:healthy"] QUEUE["@icon:aws:simple-queue-service **Order queue** | sub:SQS"] WORKER["@icon:aws:lambda **Fulfilment** | sub:Lambda"] TABLE[("@icon:aws:dynamodb **Orders table** | sub:DynamoDB")] BUCKET[("@icon:aws:simple-storage-service **Receipts** | sub:S3")] end USERS -->|HTTPS| CDN --> API USERS -.->|sign in| AUTH API --> ORDERS --> TABLE ORDERS -->|OrderCreated| QUEUE --> WORKER --> BUCKET ``` Icon names follow the pattern `set:name`. A few you will use often: | Service | Icon | | --- | --- | | Lambda | `aws:lambda` | | API Gateway | `aws:api-gateway` | | DynamoDB | `aws:dynamodb` | | S3 | `aws:simple-storage-service` | | SQS | `aws:simple-queue-service` | | SNS | `aws:simple-notification-service` | | CloudFront | `aws:cloudfront` | | Cognito | `aws:cognito` | | RDS / Aurora | `aws:rds`, `aws:aurora` | | EventBridge | `aws:eventbridge` | | CloudWatch | `aws:cloudwatch` | You don't need to remember them: the **Rich node** builder in the editor searches more than 15,000 icons by name or abbreviation, including Google Cloud, Azure and Kubernetes, and writes the line for you. To skip the blank page, the [Templates](/templates) page has ready-made AWS, Azure and Google Cloud architectures (serverless order processing, static websites, a three-tier app in a VPC, streaming analytics and more) to adapt. ## 5. Or use Mermaid's architecture diagram Mermaid also has a dedicated `architecture-beta` diagram, with groups, services and edges that attach to a side of each box (`L`, `R`, `T`, `B`). Flowgraph Studio supports the same icon sets in it: ```mermaid architecture-beta group cloud(logos:aws)[AWS] service api(aws:api-gateway)[API Gateway] in cloud service fn(aws:lambda)[Orders] in cloud service db(aws:dynamodb)[Orders table] in cloud api:R --> L:fn fn:R --> L:db ``` Flowcharts are more flexible (labels on links, shapes, styling); architecture diagrams give a tidier grid for simple service maps. ## Tips for diagrams people actually read - **One question per diagram.** "How does an order flow?" and "What runs where?" are two diagrams. Past about 15 boxes, split it. - **Left to right for requests, top to bottom for layers.** - **Label every connection** with the protocol, event or data that moves. - **Use dotted links** for asynchronous or optional paths, solid for the main path. - **Show state with color, not words:** a status light or a badge says "degraded" faster than a note. - **Match the destination:** a dark theme suits a screen share; for a design doc or a slide, a light style such as Print Ready or Slide Deck reads better and prints cleanly. ## Keep it up to date Because the diagram is text, it can live in the repository next to the infrastructure code and change in the same pull request. With Flowgraph Studio's [render API](/docs/render-api) a build step can turn the `.mmd` file into an SVG or PNG with your theme, so the image in your docs always matches the code. Want a refresher on the syntax? See the [Mermaid flowchart cheat sheet](/guides/mermaid-flowchart-cheat-sheet/). --- # How to turn a LinkedIn post into an infographic and a carousel Source: https://flowgraph.studio/guides/linkedin-post-to-infographic/ Updated: 2026-11-19 Turn the core idea of a LinkedIn post into a portrait infographic and a swipeable PDF carousel: how to structure it, which layout fits which post, and how to make one in minutes. A good post often has a structure hiding in it: steps, a comparison, a list of lessons. Drawing that structure as a graphic gives people something to stop on in the feed, and something to save. This guide shows how to find the structure, which layout fits it, and how to produce both a single image and a carousel. ## Find the one idea An infographic carries one idea, not the whole post. Before designing anything, write down: - **A title** that says what the reader gets: "The 5-step safe release checklist", not "Some thoughts on releases". - **A one-line hook** that explains why it matters. - **Three to eight points**, each a short title and one sentence. - **One takeaway**: the line you want remembered. If you can't fill those in, the post probably needs editing before it needs a graphic. ## Pick the layout that matches the idea The shape of the idea decides the layout: | If the post is... | Use | | --- | --- | | A how-to or checklist done in order | **Numbered steps** | | A process where each stage hands over to the next | **Flow** | | Two options side by side: before and after, X vs Y, myth and fact | **Comparison** | | A stack where each layer builds on the one below | **Layers** | | A loop that repeats: a feedback loop, a lifecycle | **Cycle** | | One central idea with related parts around it | **Hub and spoke** | | A hierarchy or priority order | **Pyramid** | | Independent tips or lessons with no order | **Key points** | | A few results or figures that carry the post | **Big numbers** | | Milestones with dates: a career, a project, a roadmap | **Timeline** | | Four groups sorted on two dimensions, such as effort against impact | **2×2 matrix** | | Stages that each keep fewer of the same things: visitors, sign-ups, customers | **Funnel** | | Changes from one way to another, point by point | **Before → after** | | Things to do and to avoid, or myths and facts | **Do and don’t** | | An opinion carried by one strong line | **Quote** | | Two or three ideas whose overlap is the point | **Venn** | | What people see against what lies underneath | **Iceberg** | | Two to four options compared on the same few criteria | **Table** | | A short piece of code and what its lines do | **Code and explanation** | | Questions that lead the reader to the right choice | **Decision tree** | | A story: the problem, what changed, what happened, the lesson | **Case study** | Here is a checklist post drawn as numbered steps: ```explainer {"title":"The safe release checklist","subtitle":"Most outages come from releases without a plan, not from bad code.","layout":"steps","items":[{"title":"Reviewed pull request","text":"A second pair of eyes on every change before it ships.","icon":"lucide:git-pull-request"},{"title":"Green CI","text":"Automated tests must pass before anything goes out.","icon":"lucide:circle-check"},{"title":"Canary at 5%","text":"Release to a small slice of traffic first.","icon":"lucide:percent"},{"title":"Dashboards on screen","text":"Watch errors and latency while the release rolls out.","icon":"lucide:chart-line"},{"title":"Rollback ready","text":"Have the rollback command ready to paste.","icon":"lucide:undo-2"}],"takeaway":"Ten minutes of preparation saves nights of firefighting."} ``` ## Get the format right for LinkedIn - **Single image:** use a portrait image, 1080 × 1350 pixels (4:5). It takes up more of the feed than a square or landscape image. - **Carousel:** LinkedIn shows a PDF uploaded as a *document* as a swipeable carousel. Make a cover slide, one slide per point, and a closing slide with the whole picture. - **Large text:** most people read on a phone. If a point needs more than one sentence, it is two points. - **Your name on it:** graphics get shared without the post. A small footer with your name, handle and photo keeps the credit attached. - **Alt text:** add a short description when you upload the image, so it is accessible to people using screen readers. ## Make one in Flowgraph Studio The LinkedIn explainer in [Flowgraph Studio](/projects) does the structuring and the design for you: 1. In **Projects**, choose **New LinkedIn explainer**. Or start from one of the sample explainers on the [Templates](/templates) page, which doesn't use the AI. 2. **Paste your post.** A quick AI check suggests the layout that fits, and a style, with the reason. You can pick another. 3. Choose **Make my explainer**. The AI writes the title, hook, points with icons, and takeaway. (The code, decision tree and case study layouts are filled in by hand, from a template.) 4. **Edit anything.** Change the wording, reorder or add points, swap icons, or switch the layout; the preview updates as you type. Big numbers, timelines, and funnels have a field for each point's figure or date, a matrix for the names of its axes, and a table for its options and each row's answers (✓ or ✗ alone draws as a mark). 5. Pick a style (clean light, bold dark, gradient or whiteboard), or apply your own brand kit (colours, font and logo), and turn your name, handle and photo on or off. 6. **Export:** download a PNG for a single-image post, copy the image straight into a post, download the carousel PDF to upload as a document, or get the slides as an editable PowerPoint. You can also share it as a link to a page with the infographic and the carousel. Every explainer is saved in its project, so you can come back and make a variation later. LinkedIn explainers are included in the Pro and Pro Max plans; see [pricing](/pricing). ## A quick checklist before you post - Does the title promise something specific? - Can each point be read in a few seconds? - Does the graphic still make sense without the post? - Is your name on it? - Did you add alt text? If you also draw technical diagrams, see [how to draw an AWS architecture diagram with Mermaid](/guides/aws-architecture-diagram-mermaid/). --- # Mermaid flowchart syntax: a practical cheat sheet Source: https://flowgraph.studio/guides/mermaid-flowchart-cheat-sheet/ Updated: 2026-11-19 Every part of a Mermaid flowchart in one place: directions, node shapes, arrows and labels, subgraphs, styling, and the mistakes that break a diagram, with examples you can paste. Mermaid turns a few lines of text into a flowchart. This cheat sheet covers the syntax you will use every day, with a rendered example for each part. Every example works in any Mermaid editor; paste it into [Flowgraph Studio](/projects) to see it with themes and a cleaner layout. ## Start a flowchart Every flowchart starts with the word `flowchart` and a direction. The direction decides which way the chart grows. | Direction | Meaning | | --- | --- | | `TB` or `TD` | Top to bottom (the default) | | `BT` | Bottom to top | | `LR` | Left to right | | `RL` | Right to left | ```mermaid flowchart LR A[Write code] --> B[Open a pull request] --> C[Merge] ``` Each line after the first declares nodes, links, or both. A node is an id followed by its text in brackets; after that, you can refer to it by id alone. ## Node shapes The brackets around a node's text choose its shape. | Syntax | Shape | | --- | --- | | `A[Text]` | Rectangle | | `A(Text)` | Rounded rectangle | | `A([Text])` | Stadium (pill) | | `A[[Text]]` | Subroutine | | `A[(Text)]` | Database (cylinder) | | `A((Text))` | Circle | | `A(((Text)))` | Double circle | | `A>Text]` | Flag | | `A{Text}` | Diamond (decision) | | `A{{Text}}` | Hexagon | | `A[/Text/]` | Parallelogram | | `A[/Text\]` | Trapezoid | ```mermaid flowchart LR start([Order received]) --> check{In stock?} check -->|Yes| pack[Pack the order] check -->|No| wait[[Back-order process]] pack --> db[(Orders DB)] ``` If the text contains brackets, quotes or other symbols, wrap it in double quotes: `A["Total (incl. tax)"]`. ## Arrows and links | Syntax | Link | | --- | --- | | `A --> B` | Arrow | | `A --- B` | Line without an arrow | | `A -.-> B` | Dotted arrow | | `A ==> B` | Thick arrow | | `A --o B` | Circle end | | `A --x B` | Cross end | | `A <--> B` | Arrows both ways | | `A ~~~ B` | Invisible link (affects layout only) | Add a label with pipes, `A -->|label| B`, or inline, `A -- label --> B`. Adding dashes, as in `A ---> B`, makes a link longer, which pushes the target further away. You can chain links and connect several nodes at once: ```mermaid flowchart LR web[Web app] & mobile[Mobile app] -->|HTTPS| api[API] --> db[(Database)] api -.->|async| queue[Queue] ``` ## Subgraphs A subgraph draws a box around related nodes: a service boundary, a network, a team. Give it an id and a title, and end it with `end`. Links can point at a subgraph as a whole. ```mermaid flowchart LR user([Customer]) --> lb[Load balancer] subgraph cluster [Kubernetes cluster] direction TB lb --> app1[App pod 1] lb --> app2[App pod 2] end cluster --> cache[(Redis)] ``` The `direction` line inside a subgraph sets its own layout direction. ## Styling nodes and links Define a class once with `classDef`, then attach it with `:::` or a `class` line. `style` styles a single node, and `linkStyle` styles links by their position (counting from 0). ```mermaid flowchart LR classDef risk fill:#fef3f2,stroke:#d92d20,color:#7a271a classDef ok fill:#ecfdf3,stroke:#039855,color:#054f31 deploy[Deploy] --> canary[Canary at 5%]:::ok canary --> rollout[Full rollout]:::ok canary --> rollback[Roll back]:::risk linkStyle 2 stroke:#d92d20,stroke-dasharray:4 3 ``` In Flowgraph Studio you usually don't need any of this: pick a theme and every node, link and group gets a consistent look, with text colors that stay readable. ## Comments Lines starting with `%%` are comments and are ignored when drawing: ```text flowchart TD %% The happy path A --> B ``` ## Mistakes that break a flowchart - **The word `end` in lowercase.** As node text it closes a subgraph early. Write `End`, `END`, or `A["end"]`. - **Ids starting with `o` or `x` after a link.** `A---oB` makes a circle-ended link to `B`. Add a space (`A --- oB`) or rename the node. - **Unbalanced brackets or quotes.** Every `[`, `(` and `{` needs its partner. When a label has symbols, quote the whole label. - **Missing arrow ends.** `A -- B` is incomplete; use `A --- B` or `A --> B`. In Flowgraph Studio the status bar names the line Mermaid couldn't read, and the canvas keeps the last good drawing while you fix it. ## Make it presentation-ready Plain Mermaid gets the structure right; the look is up to you. In [Flowgraph Studio](/projects) the same code gets: - **Themes** that restyle the whole diagram in one click, including light styles made for articles, slides and print. - **Layout engines** (ELK layered, tree, stress or radial, a grid, or Dagre), a direction switch, spacing, and line styles for cleaner charts. - **Rich nodes** with icons, subtitles, badges and a status light, written inside the label, such as `API["@icon:aws:lambda **Orders API** | sub:Python | status:healthy"]`. - **Manual mode**, to drag, resize and connect nodes, move a connection's ends to any side of a node, and move a node's text, while the code updates. - **Downloads that match the screen**: PNG and SVG files keep the diagram's font and line breaks, so they look the same in a document or a slide deck. - **Templates** to start from: dozens of ready-made flowcharts, sequence diagrams and cloud architectures on the [Templates](/templates) page. Next, see how to [draw an AWS architecture diagram with Mermaid](/guides/aws-architecture-diagram-mermaid/) using these pieces. --- # Mermaid sequence diagrams: a step-by-step tutorial Source: https://flowgraph.studio/guides/mermaid-sequence-diagram/ Updated: 2026-11-19 Learn Mermaid sequence diagrams from the first message to a full sign-in flow: participants and actors, arrow types, activations, notes, loops, alternatives and numbering. A sequence diagram shows who talks to whom, in what order. It is the clearest way to explain an API call, a sign-in flow or a payment, and in Mermaid it reads almost like the conversation itself. This tutorial builds one up a feature at a time. ## Your first sequence diagram Start with `sequenceDiagram`, then write one message per line: sender, arrow, receiver, colon, text. ```mermaid sequenceDiagram Browser->>Server: POST /login Server->>Database: Find user by email Database-->>Server: User record Server-->>Browser: 200 OK and a session cookie ``` Participants appear in the order they are first mentioned. Solid arrows are calls; dotted arrows are replies. ## Participants, actors and aliases Declare participants up front to control their order and give them short ids with readable names. Use `actor` for a person. ```mermaid sequenceDiagram actor U as Customer participant W as Web app participant P as Payments API U->>W: Click "Pay" W->>P: Create payment P-->>W: Payment confirmed W-->>U: Show receipt ``` ## Arrow types | Syntax | Meaning | | --- | --- | | `A->>B` | Solid line with an arrowhead (a call) | | `A-->>B` | Dotted line with an arrowhead (a reply) | | `A->B` | Solid line, no arrowhead | | `A-->B` | Dotted line, no arrowhead | | `A-xB` | Solid line ending in a cross (failed or lost) | | `A--xB` | Dotted line ending in a cross | | `A-)B` | Solid line with an open arrow (asynchronous) | | `A--)B` | Dotted line with an open arrow | ## Activations An activation bar shows when a participant is busy. Add `+` after the arrow to start one and `-` to end it: ```mermaid sequenceDiagram Client->>+API: GET /orders API->>+Database: SELECT orders Database-->>-API: 12 rows API-->>-Client: 200 OK ``` ## Notes Notes explain what happens inside a step. Place them `left of`, `right of` or `over` one or two participants. ```mermaid sequenceDiagram participant App participant Auth Note over App: Generate a PKCE verifier and challenge App->>Auth: /authorize with the challenge Note right of Auth: Checks the client and redirect URI Auth-->>App: Authorization code ``` ## Loops, alternatives and optional steps Blocks group messages and end with `end`: - `loop` for repetition - `alt` with one or more `else` for branches - `opt` for a step that may not happen - `par` with `and` for parallel messages - `critical` and `break` for must-succeed steps and early exits - `rect rgb(...)` to highlight a region ```mermaid sequenceDiagram participant W as Worker participant Q as Queue participant S as Service loop Every 5 seconds W->>Q: Poll for messages end alt Message received W->>S: Process it S-->>W: Done else Queue empty W->>W: Sleep end opt Error rate above 1% W->>S: Send an alert end ``` ## Number the steps Put `autonumber` on the second line and every message gets a number, which makes a diagram easy to discuss ("step 4 fails"). ## A complete example: sign-in with OAuth and PKCE ```mermaid sequenceDiagram autonumber actor U as User participant A as Single-page app participant I as Identity provider participant R as Resource API U->>A: Click "Sign in" Note over A: Create a code verifier and challenge A->>I: GET /authorize with the challenge I-->>U: Ask for credentials and MFA U->>I: Sign in I-->>A: Redirect with an authorization code A->>+I: POST /token with the code and verifier I-->>-A: ID token and access token A->>+R: GET /workspace with the access token R-->>-A: 200 OK A-->>U: Show the dashboard ``` ## Tips - **Keep each diagram to one scenario.** Put the error path in its own diagram, or in an `alt` block, rather than both in one long chain. - **Name messages after what they do** ("Create payment"), not the function ("createPmt"). - **Use replies consistently:** dotted for responses makes the call structure obvious. In [Flowgraph Studio](/projects), sequence diagrams pick up your theme, and Manual mode lets you add, rename and reorder participants and messages on the canvas while the Mermaid code stays in step. When the flow changes, **Compare versions** lines up two versions and marks the participants and messages that were added, removed, reworded or moved to other participants. Ready-made sequences, such as an OAuth sign-in, a web request with a cache, and webhook retries, are on the [Templates](/templates) page. For the other diagram you'll draw most, see the [Mermaid flowchart cheat sheet](/guides/mermaid-flowchart-cheat-sheet/).