API ReferenceNode Types & Shapes

Node Types & Shapes

Nodes are the primary building blocks of a topology. Each node represents a single process, service, or infrastructure component. The visual appearance is controlled by the shape property and a set of optional styling flags.


Available shapes

The shape property is set in addProcess (or createProcess) and controls the SVG geometry rendered inside the node card.

Shape valueDescriptionTypical use
defaultRounded rectangleAPIs, services, workers, any generic process
cylinderVertical cylinderDatabases, message brokers, caches, storage
diamondDiamond / rhombusDecision points, gateways, condition checks
cloudCloud silhouetteExternal cloud services, CDNs, SaaS providers
hexagonHexagonMicroservices, functions, specialized workers
parallelogramSlanted rectangleData transformation, ETL steps
circleCircleEvents, queues, lightweight signals
group
  .addProcess({ id: 'api',       label: 'REST API',      shape: 'default',       state: 'running' })
  .addProcess({ id: 'pg',        label: 'PostgreSQL',    shape: 'cylinder',      state: 'running' })
  .addProcess({ id: 'gateway',   label: 'API Gateway',   shape: 'diamond',       state: 'running' })
  .addProcess({ id: 'cdn',       label: 'CloudFront',    shape: 'cloud',         state: 'running' })
  .addProcess({ id: 'lambda',    label: 'Lambda Fn',     shape: 'hexagon',       state: 'running' })
  .addProcess({ id: 'transform', label: 'Transform',     shape: 'parallelogram', state: 'running' })
  .addProcess({ id: 'event',     label: 'Event',         shape: 'circle',        state: 'running' })
  .autoResize();

State indicators

The state property adds a colored indicator dot to the node label, making it easy to show the health of each component.

StateIndicator colorMeaning
runningGreenService is healthy and operational
warningYellowService is degraded or approaching a limit
errorRedService is failing or has failed
stoppedGrayService is intentionally stopped or offline
group
  .addProcess({ id: 'healthy',  label: 'Healthy Service',  state: 'running' })
  .addProcess({ id: 'degraded', label: 'Degraded Service', state: 'warning' })
  .addProcess({ id: 'failed',   label: 'Failed Service',   state: 'error' })
  .addProcess({ id: 'offline',  label: 'Stopped Service',  state: 'stopped' })
  .autoResize();

External components

Setting external: true on a node marks it as an external dependency — a service that lives outside the system being described (a third-party SaaS, a public cloud API, a partner system).

External nodes receive a distinct orange border and a slightly different background fill to visually separate them from internal components.

group
  .addProcess({ id: 'stripe',   label: 'Stripe API',   shape: 'cloud', external: true, state: 'running' })
  .addProcess({ id: 'sendgrid', label: 'SendGrid',     shape: 'cloud', external: true, state: 'running' })
  .addProcess({ id: 'twilio',   label: 'Twilio SMS',   shape: 'cloud', external: true, state: 'running' })
  .autoResize();

Alternatively, use the addCloud shorthand on GroupBuilder, which sets shape: 'cloud' and external: true automatically:

group.addCloud({ id: 'stripe', label: 'Stripe API', state: 'running' });

Shard badges

For distributed databases and sharded systems, each node can display a shard identifier and role badge.

PropertyTypeValuesDescription
shardIdstringAny stringShard identifier shown as a small badge (e.g. 'shard-0', 'p0')
shardRolestring'primary', 'replica', 'arbiter'Role badge with color coding
group
  .addProcess({ id: 'pg-primary', label: 'PostgreSQL', shape: 'cylinder', shardId: 'shard-0', shardRole: 'primary', state: 'running' })
  .addProcess({ id: 'pg-replica', label: 'PostgreSQL', shape: 'cylinder', shardId: 'shard-0', shardRole: 'replica', state: 'running' })
  .autoResize();

Centrality heatmap

The HUB button in the canvas toolbar activates the centrality heatmap. This feature analyzes the graph structure and colors nodes by their centrality score — how many edges connect to them relative to other nodes.

  • Darker / more saturated color = higher centrality = architectural bottleneck candidate
  • Lighter color = peripheral node with few connections

The heatmap is read-only and does not affect the script or the topology data. It is a diagnostic overlay to help identify single points of failure and over-connected nodes in complex diagrams.

The heatmap is most useful on diagrams with 10+ nodes. On small topologies, all nodes tend to have similar centrality scores and the overlay adds little value.


Replica naming

Node IDs ending with a numeric suffix are automatically treated as replicas of the base name. The FlowBuilder uses this to distribute animation packets across replicas via round-robin or random selection.

// These three nodes are replicas of 'api'
group
  .addProcess({ id: 'api-1', label: 'API Pod 1', state: 'running' })
  .addProcess({ id: 'api-2', label: 'API Pod 2', state: 'running' })
  .addProcess({ id: 'api-3', label: 'API Pod 3', state: 'running' })
  .autoResize();
 
// Animation targeting 'api' sends to one of api-1, api-2, api-3
flow.from('lb').to('api').showMessage('[ROUTED] Picked api-2');

IDs with non-numeric suffixes are distinct nodes — cb-counter and cb-state are not replicas of cb.