Skip to main content

Source: docs/manual/premium-flow-editor.md

This page is generated by site/scripts/sync-manual-docs.mjs.

Premium Flow Editor

The premium flow editor extends the Visual Flow Builder with smart edge routing, auto-layout, a CodeMirror expression editor, execution visualization, workflow templates, version diff, and collaborative editing.

Source: cmd/ui/frontend/src/components/flow-v2/, cmd/ui/frontend/src/hooks/, cmd/ui/frontend/src/lib/

Smart Edges and Auto-Layout

Smart edge routing uses A* pathfinding to route edges around nodes instead of through them. Edges follow orthogonal paths with rounded corners, producing clean visual output even on dense graphs.

Auto-layout uses ELK.js running in a Web Worker. The layout engine supports multiple algorithms (layered, stress, mrtree, radial) and handles nested structures like Subgraph and Parallel nodes correctly. The "Tidy up" toolbar button triggers a full re-layout with animated 300ms transitions.

Command Palette

Press Cmd+K (or Ctrl+K) to open the command palette. It provides fuzzy-search access to all editor actions: add nodes, toggle settings, trigger layout, open templates, and navigate between workflows. The palette is built on the cmdk library.

Keyboard Shortcuts

Comprehensive keyboard shortcuts cover common operations:

ShortcutAction
Cmd+Z / Cmd+Shift+ZUndo / Redo
Cmd+C / Cmd+VCopy / Paste nodes
Cmd+DDuplicate selected
Cmd+ASelect all
Delete / BackspaceDelete selected
Cmd+G / Cmd+Shift+GGroup / Ungroup
Cmd+KCommand palette
Cmd+FCanvas search
F2Rename selected node
LAuto-layout
EscapeDeselect / drill out / close search

Undo/redo is powered by zundo (Zustand temporal middleware) with a configurable stack depth.

Expression Editor

Node configuration fields that accept expressions use a CodeMirror 6 editor with a custom Lezer grammar. The grammar recognizes {{ expression }} template syntax with JavaScript delegation for the expression body.

Features:

  • Context-aware autocomplete from upstream node outputs ($input, $node['name'])
  • Inline evaluation preview showing the expression result
  • Syntax highlighting for template delimiters, variables, and JS operators
  • Drag-to-map: drag a field from the upstream data panel into the expression editor to insert a reference

Sticky Notes and Grouping

Sticky notes are canvas annotations with TipTap rich-text editing. They support bold, italic, headings, lists, and code blocks. Four color presets are available (yellow, blue, green, pink). Sticky notes render behind workflow nodes.

Node groups organize related nodes into labeled containers with a dashed border. Groups are created by selecting multiple nodes and pressing Cmd+G. Groups can be collapsed to hide their contents, and double-clicking a collapsed group drills into it.

Node comments attach markdown notes to individual nodes via a comment icon that appears on hover.

Press Cmd+F to open canvas search. It performs fuzzy matching against node labels, descriptions, types, and tool names. Non-matching nodes dim to 30% opacity (spotlight mode). Use Enter / Shift+Enter to cycle through matches with auto-pan.

Execution Visualization

During workflow execution, the editor shows real-time status:

  • Node status overlays: pulsing borders (running), green flash (success), red shake (error), amber pulse (retrying), dimmed (skipped)
  • Timing badges: elapsed time per node, updating in real-time via requestAnimationFrame
  • Animated edge particles: 6 SVG dots flow along active edges using the Web Animations API
  • Execution timeline: horizontal Gantt-style bar at canvas bottom showing node durations, with parallel branches on separate rows

Execution state streams from the server via SSE with auto-reconnect and exponential backoff.

Subflow Navigation

Double-click a Subgraph node or collapsed group to drill into its contents. A breadcrumb bar above the canvas shows the navigation path (e.g., Root > Parallel Branch A > Data Pipeline). Each breadcrumb segment is clickable for direct navigation. Press Escape to drill out one level.

Viewport state (pan position and zoom) is preserved per navigation level for seamless back-navigation. Transitions use 300ms animated zoom.

Workflow Templates

The template gallery (Templates toolbar button) provides pre-built workflow patterns:

TemplateCategoryDifficulty
Simple Agent LoopAgent LoopsBeginner
RAG PipelineData PipelinesBeginner
Approval WorkflowIntegrationsIntermediate
Parallel Data ProcessingData PipelinesIntermediate
Supervisor DelegationMulti-AgentAdvanced
Saga PatternMulti-AgentAdvanced
Debate PatternMulti-AgentAdvanced
MCP Integration PipelineIntegrationsIntermediate

Templates can replace the current canvas or be inserted into it at the viewport center. Templates are served from the filesystem via a Go API endpoint.

Version Diff

The version diff overlay compares the current canvas state against a previous version. Nodes are color-coded:

  • Added: green border and background
  • Removed: red dashed border
  • Modified: amber border with field-level change details
  • Unchanged: dimmed to 30% opacity

A detail panel shows all changes grouped by type. Click a modified node to see per-field from/to values.

Collaborative Editing

When enabled, multiple users can edit the same workflow simultaneously. Collaborative editing uses Yjs CRDTs for conflict-free synchronization over WebSocket.

Features:

  • Real-time node/edge sync across all connected users
  • Remote cursor indicators (colored avatars at each user's viewport position)
  • Selection highlighting showing which nodes other users are editing
  • Presence bar with connected user avatars
  • Follow mode: click a user's avatar to sync your viewport to theirs
  • Per-user undo/redo via Y.UndoManager

Collaborative editing is gated behind the CRUVERO_FLOW_COLLAB_ENABLED feature flag. When disabled, no Yjs code is loaded.

Configuration

VariableDefaultDescription
CRUVERO_FLOW_ELK_ALGORITHMlayeredELK layout algorithm (layered, stress, mrtree, radial)
CRUVERO_FLOW_ELK_DIRECTIONDOWNLayout direction (DOWN, RIGHT, LEFT, UP)
CRUVERO_FLOW_ELK_SPACING80Node spacing in pixels
CRUVERO_FLOW_SMART_EDGEStrueEnable A* smart edge routing
CRUVERO_FLOW_SNAP_GRID20Grid snap size in pixels (0 = disabled)
CRUVERO_FLOW_UNDO_DEPTH50Max undo/redo stack depth
CRUVERO_FLOW_COLLAB_ENABLEDfalseEnable collaborative editing
CRUVERO_FLOW_COLLAB_WS_URLws://localhost:1234Yjs WebSocket server URL
CRUVERO_FLOW_TEMPLATES_DIRtemplates/workflowsDirectory for workflow templates