ObjectStackObjectStack

Flow Builder

Flow Builder protocol schemas

@module studio/flow-builder

Studio Flow Builder Protocol

Defines the specification for the visual Flow Builder (automation canvas)

within ObjectStack Studio. Covers:

  • Node Shape Registry: Shape and visual style per FlowNodeAction type

  • Canvas Node: Position, size, and rendering hints for each node on canvas

  • Canvas Edge: Visual properties for sequence flows (normal, default, fault)

  • Flow Builder Config: Canvas settings, palette, minimap, and toolbar

Architecture


┌──────────────────────────────────────────────────────────────┐

│  Toolbar (run / save / undo / zoom / layout)                │

├──────────┬───────────────────────────────────┬───────────────┤

│  Node    │       Canvas                      │  Property     │

│  Palette │  ┌─────┐    ┌──────────┐          │  Panel        │

│          │  │start│───▶│ decision │──▶ ...   │  (node-aware) │

│  ─ BPMN  │  └─────┘    └──────────┘          │               │

│  ─ CRUD  │       ┌──────────┐                │  ─ config     │

│  ─ Logic │       │parallel  │                │  ─ edges      │

│  ─ HTTP  │       │ gateway  │                │  ─ validation │

├──────────┴───────────────────────────────────┴───────────────┤

│  Minimap / Zoom Controls                                     │

└──────────────────────────────────────────────────────────────┘

Source: packages/spec/src/studio/flow-builder.zod.ts

TypeScript Usage

import { FlowBuilderConfig, FlowCanvasEdge, FlowCanvasEdgeStyle, FlowCanvasNode, FlowLayoutAlgorithm, FlowLayoutDirection, FlowNodeRenderDescriptor, FlowNodeShape } from '@objectstack/spec/studio';
import type { FlowBuilderConfig, FlowCanvasEdge, FlowCanvasEdgeStyle, FlowCanvasNode, FlowLayoutAlgorithm, FlowLayoutDirection, FlowNodeRenderDescriptor, FlowNodeShape } from '@objectstack/spec/studio';

// Validate data
const result = FlowBuilderConfig.parse(data);

FlowBuilderConfig

Studio Flow Builder configuration

Properties

PropertyTypeRequiredDescription
snapObjectCanvas snap-to-grid settings
zoomObjectCanvas zoom settings
layoutAlgorithmEnum<'dagre' | 'elk' | 'force' | 'manual'>Default auto-layout algorithm
layoutDirectionEnum<'TB' | 'BT' | 'LR' | 'RL'>Default auto-layout direction
nodeDescriptorsObject[]optionalCustom node render descriptors (merged with built-in defaults)
showMinimapbooleanShow minimap panel
showPropertyPanelbooleanShow property panel
showPalettebooleanShow node palette sidebar
undoLimitintegerMaximum undo history steps
animateExecutionbooleanAnimate edges during execution preview
connectionValidationbooleanValidate connections before creating edges

FlowCanvasEdge

Canvas layout and visual data for a flow edge

Properties

PropertyTypeRequiredDescription
edgeIdstringCorresponding FlowEdge.id
styleEnum<'solid' | 'dashed' | 'dotted' | 'bold'>Line style
colorstringEdge line color
labelPositionnumberPosition of the condition label along the edge
waypointsObject[]optionalManual waypoints for edge routing
animatedbooleanShow animated flow indicator

FlowCanvasEdgeStyle

Edge line style

Allowed Values

  • solid
  • dashed
  • dotted
  • bold

FlowCanvasNode

Canvas layout data for a flow node

Properties

PropertyTypeRequiredDescription
nodeIdstringCorresponding FlowNode.id
xnumberX position on canvas
ynumberY position on canvas
widthintegeroptionalWidth override in pixels
heightintegeroptionalHeight override in pixels
collapsedbooleanWhether the node is collapsed
fillColorstringoptionalFill color override
borderColorstringoptionalBorder color override
annotationstringoptionalUser annotation displayed near the node

FlowLayoutAlgorithm

Auto-layout algorithm for the flow canvas

Allowed Values

  • dagre
  • elk
  • force
  • manual

FlowLayoutDirection

Auto-layout direction

Allowed Values

  • TB
  • BT
  • LR
  • RL

FlowNodeRenderDescriptor

Visual render descriptor for a flow node type

Properties

PropertyTypeRequiredDescription
actionstringFlowNodeAction value (e.g., "parallel_gateway")
shapeEnum<'rounded_rect' | 'circle' | 'diamond' | 'parallelogram' | 'hexagon' | 'diamond_thick' | 'attached_circle' | 'screen_rect'>Shape to render
iconstringLucide icon name
defaultLabelstringDefault display label
defaultWidthintegerDefault width in pixels
defaultHeightintegerDefault height in pixels
fillColorstringNode fill color (CSS value)
borderColorstringNode border color (CSS value)
allowBoundaryEventsbooleanWhether boundary events can be attached to this node type
paletteCategoryEnum<'event' | 'gateway' | 'activity' | 'data' | 'subflow'>Palette category for grouping

FlowNodeShape

Visual shape for rendering a flow node on the canvas

Allowed Values

  • rounded_rect
  • circle
  • diamond
  • parallelogram
  • hexagon
  • diamond_thick
  • attached_circle
  • screen_rect

On this page