Skip to main content

Building a Flowchart

In this tutorial you will build a complete flowchart step by step — adding nodes, connecting them with edges, applying styles, and using different shape types that correspond to standard flowchart symbols.

Time: ~15 minutes  |  Prerequisites: Getting Started completed


Step 1: Lay out the basic shapes

A flowchart uses different shapes for different purposes:

ShapeMeaningBuilder method
CircleStart / End.circle(r)
RectangleProcess.rect(w, h)
DiamondDecision.diamond(w, h)
ParallelogramInput / Output.parallelogram(w, h)
DocumentReport / Document.document(w, h)

Let's start with the first three nodes:

Step 2: Connect with edges

Now connect the nodes. Every edge needs a source and target node ID.

Step 3: Add branching and labels

The decision diamond branches into "Yes" and "No" paths. Use .label() on edges to annotate.

Notice: the "retry" edge uses .curved() to route the loop back to the input without overlapping other edges.

Step 4: Complete the flowchart

Add a document node for the output and a terminal circle:

What you learned

In this tutorial you:

  1. Used standard flowchart shapes — circles, rectangles, diamonds, parallelograms, and documents.
  2. Connected nodes with directed edges using .arrow().
  3. Added edge labels to annotate branches.
  4. Used curved routing for loopback edges.
  5. Applied fills and strokes for visual distinction.

Next steps


Found a problem? Open an issue on GitHub.