> ## Documentation Index
> Fetch the complete documentation index at: https://iso-topology.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# How to edit architecture diagrams with AI without starting over

> A reproducible architecture-diagram edit: insert a queue between API and Worker, preserve existing positions, inspect the source diff, and reopen the editable project.

**To update an architecture diagram with an agent, give it the current source and layout state together, describe the exact graph change, and validate the exported project after reopening it.** Keeping the component IDs stable lets you review an architectural change without also renaming everything in the drawing.

Here is a small, reproducible example with iso-topology: replace a direct API-to-Worker connection with API → Queue → Worker. Keep the client, API, Redis, Postgres and worker in their existing positions. Then make another edit to the saved project.

![Before and after adding a queue, with matched scale, colors and existing node positions](https://mintcdn.com/iso-topology/QGUfjN9rN6x-RDkX/assets/articles/queue-edit/comparison.svg?fit=max\&auto=format\&n=QGUfjN9rN6x-RDkX\&q=85\&s=5ea95bcc717f05aadd54c202ba2a37f8)

[Full-size comparison](https://iso-topology.mintlify.site/assets/articles/queue-edit/comparison.png) · [Before project](https://iso-topology.mintlify.site/assets/articles/queue-edit/before.isotopo.json) · [After project](https://iso-topology.mintlify.site/assets/articles/queue-edit/after.isotopo.json) · [Exact source diff](https://iso-topology.mintlify.site/assets/articles/queue-edit/change.diff)

## What changes, and what stays the same?

Imagine a service that calls a worker directly. You want the API to enqueue work instead, with a worker consuming it later. This diagram illustrates that proposed change; it does not implement a queue or prove the application's delivery guarantees.

| Property | Before | After |
| - | - | - |
| Components | Client, API, Redis, Postgres, Worker | The same five, plus Queue |
| Job path | API → Worker | API → Queue → Worker |
| Directed connections | 5 | 6 |
| Existing component IDs and positions | Authored explicitly | Preserved |
| Existing colors, shapes and typography | Dark canvas, mint API, blue data stores | Preserved |
| Source and layout state | Saved together in a project | Saved together in the revised project |

The direct API-to-Worker edge is removed. Client-to-API, API-to-Redis, API-to-Postgres and Worker-to-Postgres remain unchanged. The new queue uses the same visual language as the worker, so the comparison emphasizes topology rather than a restyling.

**The starting layout reserves space for the queue and uses explicit positions.** In a crowded diagram, make room for the new component before routing its connections.

## 1. Open the existing editable project

[Install the CLI](https://iso-topology.mintlify.site/getting-started/01-install.md), download the [before project](https://iso-topology.mintlify.site/assets/articles/queue-edit/before.isotopo.json), and run:

```bash theme={"system"}
isotopo serve before.isotopo.json
```

Open the local URL printed in your terminal. The `.isotopo.json` file carries both the architecture source and its layout state. Start from this file rather than asking an agent to reconstruct the architecture from the screenshot.

![The starting five-component service architecture](https://mintcdn.com/iso-topology/QGUfjN9rN6x-RDkX/assets/articles/queue-edit/before.svg?fit=max\&auto=format\&n=QGUfjN9rN6x-RDkX\&q=85\&s=a936316c33f40c0031bba6a6b63e2682)

Save any edits before the agent reads the file. Stop the local server while an external agent edits the project, then reopen the resulting file. That avoids two writers overwriting one another's revision.

## 2. Give the agent a bounded change

Use a request that names both the desired mutation and the invariants:

```text theme={"system"}
Read before.isotopo.json from disk.

Add a Queue between API and Worker for asynchronous job dispatch.
Remove only the direct API-to-Worker connector.
Add API-to-Queue and Queue-to-Worker connectors.

Keep the IDs client, api, cache, db and worker unchanged.
Preserve their authored positions, styles, labels and unrelated fields.
Place the queue in the open space before the worker.
Use orthogonal routing along the isometric axes and the existing edge color.
Do not add retries, a dead-letter queue or other architecture I did not request.

Carry the current layout_state into the next design call.
Save to a new project file; preserve the original.
Inspect the graph diff, render report and SVG.
Reopen the exported project and check that it reproduces the revised SVG.
Report any residual warnings instead of claiming the result is warning-free.
```

The agent authors the change; iso-topology renders the submitted description. A working drawing is not evidence that a queue exists in your deployed application. If your source of truth is code or infrastructure configuration, [record the evidence for each component and connection](https://iso-topology.mintlify.site/guides/architecture-diagrams-from-code.md).

For an [MCP client](https://iso-topology.mintlify.site/agent/MCP.md), pass the edited source as `dsl` and the current `layout_state` as `previous` to `iso_design`. Carry forward the newly returned source/state pair. Do not feed the original project back into a later turn after somebody has edited the saved revision.

## 3. Review the source change before the picture

Download the [before YAML](https://iso-topology.mintlify.site/assets/articles/queue-edit/before.yaml), [after YAML](https://iso-topology.mintlify.site/assets/articles/queue-edit/after.yaml) and [full diff](https://iso-topology.mintlify.site/assets/articles/queue-edit/change.diff).

The logical edge change is:

```diff theme={"system"}
- API → Worker
+ API → Queue
+ Queue → Worker
```

The full source diff also contains the queue's geometry, icon, palette and position, plus route waypoints. Those fields are part of an editable drawing; a diagram diff will often be larger than a one-line architectural summary.

Review three things independently:

1. **Graph:** the direct edge disappeared and both replacement edges exist. There is exactly one new component.
2. **Unrelated content:** existing IDs, labels, styles and positions stayed intact. No invented infrastructure appeared.
3. **Drawing:** arrows reach the intended components; the queue label is readable; new routes do not hide behind unrelated objects.

A successful parse checks syntax and structure. It does not replace looking at the output or reviewing whether the architecture itself makes sense.

## 4. Render and reopen the revised project

To inspect the checked result immediately, download the [after project](https://iso-topology.mintlify.site/assets/articles/queue-edit/after.isotopo.json):

```bash theme={"system"}
isotopo design after.isotopo.json out/queue-edit
isotopo serve out/queue-edit/project.isotopo.json
```

![The revised service architecture with API to Queue to Worker](https://mintcdn.com/iso-topology/QGUfjN9rN6x-RDkX/assets/articles/queue-edit/after.svg?fit=max\&auto=format\&n=QGUfjN9rN6x-RDkX\&q=85\&s=998f95c7e73ae5f364a89f0ed3b2ca10)

The design output includes `topology.svg`, `report.json` and the editable `project.isotopo.json`. Inspect the report and the exported image from the same revision. Do not publish an old preview after a failed edit.

The project is the handoff artifact. The SVG is the published drawing. Keep both in Git if you want readers to see the result and reviewers to inspect the editable source. For a README workflow, see [publishing diagrams](https://iso-topology.mintlify.site/getting-started/05-publishing.md).

## 5. Make a second edit

In Studio, select Worker and change its display label to Jobs while keeping its ID `worker`. Wait for the save confirmation. Stop the server, then run:

```bash theme={"system"}
isotopo design out/queue-edit/project.isotopo.json out/renamed
isotopo serve out/renamed/project.isotopo.json
```

Check that Jobs appears, the queue remains connected, and the other components retain their positions. Hand this latest project to the next participant so they continue from your saved changes.

For manually dragged diagrams and the distinction between source coordinates and saved layout state, read [preserving diagram layout](https://iso-topology.mintlify.site/guides/preserve-diagram-layout.md).

## What was actually verified?

The repository contains a runnable reproduction at `tools/queue-edit/build.py`. It builds the real CLI, starts from the before source, inserts the queue node and replaces the direct connector, then designs the edited project using the previous state.

The checks verify that:

* Every existing node definition remains byte-for-byte unchanged, including the source comment.
* The connector count changes from five to six.
* Existing saved positions are preserved.
* Both exported projects reproduce their SVG when reopened.
* A follow-up Worker-to-Jobs source edit updates the SVG, preserves positions and survives another reopen.
* The downloadable files and comparison frame match the reproducible output.

The checks run against this example with the real CLI. They do not invoke an LLM. Image reviews cover 320, 576 and 1600 pixels; inspect your own diagram at its intended display size as well.

## Common questions

### Can this modify an existing screenshot or arbitrary SVG?

This workflow starts with an iso-topology project. A screenshot does not contain the authored graph, stable IDs and layout state needed for this round trip.

### Will adding a node always leave everything else in place?

No. This example has explicit positions and enough open space. Dense diagrams may need local repositioning and rerouting. Review those changes deliberately rather than treating every layout change as a failure.

### Does drawing a queue make the system asynchronous?

No. It documents a proposed topology. Queue choice, acknowledgments, retries, idempotency, backpressure and failure handling still need application-level design and implementation.

### Is the comparison a test against Mermaid?

No. Both sides here are native iso-topology output. For a matched graph, color and font comparison across renderers, see [the Mermaid and isometric architecture examples](https://iso-topology.mintlify.site/articles/mermaid-to-isometric-architecture-diagrams.md).

### Where should I start with a coding agent?

Follow the [AI architecture diagram workflow](https://iso-topology.mintlify.site/guides/ai-architecture-diagram-workflow.md), then use this project for the first revision. For a design review with current and proposed states, continue to [current and target architecture](https://iso-topology.mintlify.site/guides/current-and-target-architecture.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.