JSON Catalog

A lookup guide for everything a Structly diagram JSON file can express today: metadata, custom node types, stages, nodes, edges, groups, side-panel entries, and playback flows.

Canonical file: .structly.json Schema: structly.schema.json Source of truth: JSON

Top Level

The renderer reads one diagram JSON file. These are the supported top-level keys.

KeyRequiredPurpose
$schemaNoPoints editors to structly.schema.json for validation and autocomplete.
metaYesDiagram title, subtitle, version, and revision metadata.
typesYesUser-defined visual categories for nodes and groups.
stagesYesOrdered lanes that decide which nodes render on the canvas.
nodesYesArchitecture components and their documentation.
edgesYesConnections between nodes.
groupsNoDashed boundaries around related nodes.
crossCuttingNoSide-panel concerns that affect many nodes (auth, observability, idempotency, DLQ recovery). Group them with each entry's category field.
fileFlowsNoAnimated playback paths for the Play button.
filePathsNoLegacy shorthand converted into fileFlows at runtime.

meta

Use metadata for display text and versioning. title is required.

FieldTypeNotes
kickerstringShort label for the system or domain.
titlestringMain diagram title.
subtitlestringOne-line context shown in workspace cards.
versionnumber or stringDiagram version.
revisionstringHuman-readable revision name.
previousVersionstringPointer to an older diagram file.
"meta": {
  "kicker": "Payments",
  "title": "Payments Platform",
  "subtitle": "Authorization, capture, settlement, and reporting",
  "version": 1
}

types

Types are fully user-defined. A type can represent services, queues, data stores, external systems, clients, jobs, agents, or anything else.

FieldTypeNotes
labelstringDisplayed in the details panel tag.
colorCSS colorUsed for node borders, group labels, and highlights.
backgroundCSS colorUsed for node and group backgrounds.
iconstringReserved for future icon rendering.
"types": {
  "service": {
    "label": "Service",
    "color": "#2563eb",
    "background": "#eff6ff"
  },
  "queue": {
    "label": "Queue",
    "color": "#b45309",
    "background": "#fffbeb"
  }
}

stages

Stages are ordered buckets of node ids. Nodes must be listed in a stage to render on the canvas.

FieldTypeNotes
idstringStable stage identifier.
labelstringReadable stage title.
nodesarrayNode ids included in this stage.
"stages": [
  {
    "id": "services",
    "label": "02 - Services",
    "nodes": ["order-service", "payment-service"]
  }
]

nodes

Nodes are architecture components. Object form is preferred, but array form is also accepted if each node includes an id.

FieldTypeNotes
idstringRequired only in array-form nodes.
typestringMust match a key in types.
titlestringMain node label. label is accepted as an alias.
summarystringSmall text under the title. sublabel is accepted as an alias.
descriptionstringMain details panel paragraph.
detailsobjectKey-value facts shown in the details panel.
codearrayCode/documentation snippets with label and snippet or content.
topicsarrayReserved documentation list for message topics.
queriesarrayReserved documentation list for query examples.
"nodes": {
  "order-service": {
    "type": "service",
    "title": "Order Service",
    "summary": "Creates and tracks orders",
    "description": "Owns order lifecycle state and emits order events.",
    "details": {
      "Language": "Go",
      "Primary table": "orders"
    },
    "code": [
      {
        "label": "event",
        "snippet": "OrderCreated { order_id, customer_id, amount, status }"
      }
    ]
  }
}

edges

Edges connect node ids. The renderer draws arrows and labels, and uses edge direction for selection highlights.

FieldTypeNotes
fromstringSource node id.
tostringTarget node id.
labelstringOptional edge label.
kindstringOptional style hint. Current known values: normal, consult, return, control, raw-write, group-flow.
animatedbooleanReserved flag for future per-edge animation control.
"edges": [
  { "from": "api-gateway", "to": "order-service", "label": "POST /orders" },
  { "from": "payment-service", "to": "payment-provider", "label": "authorize", "kind": "consult" }
]

groups

Groups draw dashed boxes around related nodes. They can include direct nodes, nested subgroups, and optional high-level flowsTo links.

FieldTypeNotes
idstringStable group identifier.
labelstringGroup label shown above the boundary.
typestringType id used for group color.
nodesarrayNode ids inside the group.
subgroupsarrayNested labeled groups, each with its own node ids.
flowsToarrayGroup ids or node ids for high-level grouped arrows.
"groups": [
  {
    "id": "core-services",
    "label": "Core Services",
    "type": "service",
    "nodes": ["order-service", "payment-service"]
  }
]

Side Panels

crossCutting is an ordered array. Entries render one after another in the cross-cutting panel. DLQ/recovery is modeled as another cross-cutting entry, not a separate concept.

FieldTypeNotes
idstringStable panel entry identifier.
shortBadgestringShort badge text shown in the panel and on affected groups. badge is accepted as an alias.
shortBadgeColorCSS colorBadge text and border color. badgeColor is accepted as an alias.
shortBadgeBackgroundCSS colorBadge background color. badgeBackground is accepted as an alias.
labelstringEntry title.
summarystringSmall text under the panel entry title.
typestringType id used for color.
notestringDetails panel role text.
nodesarrayNode ids affected by this concern. affects is accepted as an alias.
descriptionstringOptional extra documentation.
detailsobjectOptional key-value facts.
"crossCutting": [
  {
    "id": "auth",
    "shortBadge": "AU",
    "shortBadgeColor": "#0f766e",
    "shortBadgeBackground": "#ecfdf5",
    "label": "AuthN/AuthZ",
    "summary": "JWT and role checks",
    "type": "service",
    "note": "JWT validation and role checks happen at the gateway.",
    "nodes": ["api-gateway", "order-service"]
  },
  {
    "id": "dlq-recovery",
    "shortBadge": "DLQ",
    "shortBadgeColor": "#be123c",
    "shortBadgeBackground": "#fff1f2",
    "label": "DLQ Recovery",
    "summary": "Replay and manual investigation",
    "type": "external",
    "note": "Failed events route to recovery queues.",
    "nodes": ["event-bus", "payment-service"]
  }
]

fileFlows

Playback flows define ordered edge steps used by the Play button. A flow only highlights steps that match real edges.

FieldTypeNotes
idstringStable playback identifier.
labelstringLegend label while playback is active.
colorCSS colorHighlight color for active path nodes and edges.
stepsarrayOrdered objects with from and to.
"fileFlows": [
  {
    "id": "checkout",
    "label": "Checkout to fulfillment",
    "color": "#0f766e",
    "steps": [
      { "from": "web-app", "to": "api-gateway" },
      { "from": "api-gateway", "to": "order-service" }
    ]
  }
]
Legacy filePaths can use "path": ["a", "b", "c"]. The renderer converts that into a -> b and b -> c steps.

Workspace JSON

The workspace file controls the home screen and points to diagram files.

FieldTypeNotes
namestringWorkspace title.
descriptionstringShort workspace description.
diagramsarrayCards shown on the workspace page.
diagrams[].idstringUsed for route params and per-diagram layout storage.
diagrams[].titlestringCard title.
diagrams[].subtitlestringCard description.
diagrams[].pathstringPath to a diagram JSON file.
diagrams[].tagsarrayFilterable card tags.
{
  "$schema": "./structly.workspace.schema.json",
  "name": "Structly Workspace",
  "diagrams": [
    {
      "id": "orders",
      "title": "Order Platform",
      "subtitle": "Small service architecture example",
      "path": "examples/order-platform.structly.json",
      "tags": ["sample", "services"]
    }
  ]
}

Common Patterns

Microservices

Use types like client, service, queue, data, and external. Group services by bounded context.

Data Pipeline

Use stages for source, ingestion, raw lake, stream, workers, storage, compute, and consumers. Add fileFlows for source-to-consumer playback.

Platform Infrastructure

Use groups for environments or control planes. Use crossCutting for auth, observability, policy, compliance, secrets, idempotency, and DLQ recovery.

Incident Runbook

Add operational entries in crossCutting and use details fields for alert thresholds, owners, and runbook links.