Skip to content
Connect an agent
Get started

Examples to copy

Eight finished diagrams with the text that makes each one and the prompt that gets an agent to write it. Copy the text into a diagram fence, or paste the prompt into your agent and change the names to yours. It is for anyone who learns faster from a working diagram than from a reference.

TL;DR

QuestionAnswer
How do I use one?Two ways. Paste the prompt into your agent and change the names, or copy the text into a diagram fence in a Markdown file and ask your agent to render the file.
Which kinds are here?Flow (a login check, an online shop, a serverless app on AWS, a release pipeline, and a data flow that moves), sequence (a sign-in, and a password reset with numbered steps), and schema (a shop database).
What about the other kinds?Git graphs, Gantt charts, class diagrams, state diagrams, timelines, user journeys, and mind maps each have a finished example in their own guide: see Git graphs, Gantt charts, Class diagrams, State diagrams, Timelines, User journeys, and Mind maps.
Can I change them?Yes. Rename nodes, add lines, change direction. Ask your agent to check the text: it names the line and says how to fix it.
Where is the full language?Writing diagrams, kind by kind, and the language reference.
Where are cloud examples?Cloud examples for Azure, AWS, and Google Cloud, and Architecture patterns for ready-made networks.

Starter text

Start from one of these when none of the examples is close. Replace the names and add lines.

Plotwork
flow "Title" direction=down
node a service  "First"node b database "Second"
a -> b : "label"
Plotwork
sequence "Title"
actor a client  "First"actor b service "Second"
a -> b : "Request"b --> a : "Response"
Plotwork
schema "Title"
table things {  id    uuid  pk  name  text}
table parts {  id        uuid  pk  thing_id  uuid  fk}
parts.thing_id -> things.id

1. A login check

A flow with a decision. Two possible endings, drawn as terminal nodes with status icons.

Ask your agent:

text
Use Plotwork to draw how a login request is checked. A user sends an email and password to an Auth API, which looks the user up in a Users database. If the password is correct a session is issued, otherwise the API answers 401 Unauthorized.
How a login request is checked: 6 nodes, 5 connections. A user signs in through an API that checks the password against a database and answers with a session or an error.

2. An online shop with groups

Groups draw a box around related nodes. type=edge and type=data-tier give a group its icon and its color.

Ask your agent:

text
Use Plotwork to draw an online shop. A web app calls an API gateway. Behind it are Orders, Payments and Inventory services, and each has its own database. Orders calls Payments to charge and Inventory to reserve items. Put the gateway in an Edge group, the services in a Services group, and the databases in a Databases group.
Online shop services: 8 nodes, 7 connections. A web app calls an API gateway. The orders service asks the payments and inventory services to do their part, and each service keeps its own database.

3. A sign-in sequence

A sequence diagram reads top to bottom, one line per message. --> is a reply. An alt block shows two outcomes.

Ask your agent:

text
Use Plotwork to draw a sequence diagram of signing in with an identity provider. The user clicks Sign in in the web app, the app redirects to the identity provider, the user enters credentials, the provider returns an authorization code, and the app exchanges it for an access token. Then the app calls the Orders API. If the token is expired the API answers 401 and the app refreshes it.
Sign in with an identity provider: 4 participants. A web app sends the user to an identity provider, receives a code, and trades it for tokens.

4. A shop database

A schema diagram draws tables with their columns. pk marks a primary key, fk a foreign key, and a line below the tables joins one column to another.

Ask your agent:

text
Use Plotwork to draw the database of an online shop: customers (id, email, created_at), products (id, name, price in cents), orders (id, customer, placed_at, status), and order_items (id, order, product, quantity). Orders belong to customers, and each order item points at an order and a product.
Online shop: 4 tables, 3 relations. Customers place orders. An order has many items, and each item points at a product.

5. A serverless app on AWS

Cloud diagrams add icon=aws:... to a node, and type=account and type=region to groups. Ask your agent to choose the icons: it calls map_icons for every product name and never guesses.

Ask your agent:

text
Use Plotwork to draw a serverless image resizer on AWS. An upload to an S3 bucket triggers a Lambda function that resizes the image, writes it to a second S3 bucket, and sends logs to CloudWatch. Put it all in an AWS account and the eu-west-1 region.
Serverless image resizer on AWS: 5 nodes, 4 connections. An upload to S3 triggers a Lambda function that resizes the image, writes it to a second bucket, and logs to CloudWatch.

For Azure and Google Cloud, replace aws: with azure: or gcp: and the product name. Cloud examples has a complete diagram for each, and Cloud architecture explains accounts, regions, networks, and subnets.

6. A release pipeline

Status icons (status:success, status:warning, status:error) show how each step ended, which suits a pipeline, a runbook, or an incident timeline.

Ask your agent:

text
Use Plotwork to draw a release pipeline. A merged pull request is built and tested. A passing build is deployed to staging. Someone approves it, and it goes to production. If they do not approve, the release is held. Show each step with a success icon, and the held end with a warning.
Release pipeline: 7 nodes, 6 connections. A merged pull request is built and tested. A passing build is deployed to staging, then to production after approval.

7. Numbered steps in a sequence

Add numbered=on to the header and every message gets a numbered badge, so people can say "step 4" aloud. Write step=off on a message to leave its badge out.

Ask your agent:

text
Use Plotwork to draw how a password reset works as a sequence with numbered steps. A user asks the web app for a reset, the app asks the Auth API, the API has the email service send a link, the user opens the link and chooses a new password, and the API confirms.
Password reset: 4 participants. A user asks for a reset link, receives it by email, and chooses a new password. Each message carries its step number.

8. A data flow that moves

Add animate=on to the header and every line with an arrowhead gets dashes that travel toward it. Write animate=off on a line to keep it still. The motion shows when a browser or GitHub shows the SVG as an image, and it is off for readers who ask for reduced motion.

Ask your agent:

text
Use Plotwork to draw how page views flow from a website to a warehouse: a Collector, an Event stream, and a Processor in between. Animate the lines, except the acknowledgement the Processor sends back to the Collector.
Clickstream into analytics: 5 nodes, 5 connections. Page views travel from a website through a collector and a stream to a processor, which loads them into a warehouse. The acknowledgement is drawn still.

Share what you made

You wantDo
A picture fileAsk your agent: "Save this diagram as SVG files for light and dark."
The diagram in a READMEPut the text in a diagram fence and ask your agent: "Render the diagrams in README.md." See Markdown and GitHub.
A linkOn the hosted server, ask: "Publish this and give me the link." See Hosted diagrams.
A private copy for your teamAsk: "Publish this to the Platform organisation." See Organisations.

See also

DocWhy
Quick startConnect an agent and draw a first diagram
Writing diagramsThe language, kind by kind
Prompts and recipesMore requests and the tool each leads to
Cloud examplesComplete Azure, AWS, and Google Cloud diagrams
Architecture patternsChecked, ready-made diagrams to start from