Skip to main content
The CrystalFlow React package provides components to create visual workflow builder interfaces powered by React Flow.

Overview

The @crystalflow/react package includes:

WorkflowBuilder

Complete workflow editor component

Custom Hooks

React hooks for workflow management

Node Components

Customizable node renderers

Panels & Controls

Property panels and toolbars

Installation

Basic Usage

App.tsx

WorkflowBuilder Props

NodeClass[]
required
Array of node classes to make available in the palette
Workflow
Optional initial workflow to load
(workflow: Workflow) => void
Callback when workflow changes
(result: ExecutionResult) => void
Callback when workflow executes
boolean
default:"true"
Show/hide the toolbar
boolean
default:"true"
Show/hide the node palette
boolean
default:"true"
Show/hide the property panel

Complete Example

Using Custom Hooks

For more control, use the underlying hooks:

Node Palette

The node palette allows users to drag and drop nodes:

Property Panel

The property panel displays node properties and inputs:

Toolbar Actions

Work in Progress: Some toolbar features are still under development.

Customizing Appearance

Custom Node Renderer

Styling

styles.css

React Flow Integration

WorkflowBuilder is built on React Flow. Access React Flow features:

Event Handling

Handle workflow events:

Keyboard Shortcuts

Work in Progress: Keyboard shortcuts are planned for a future release.
Planned keyboard shortcuts:
  • Delete - Remove selected nodes
  • Ctrl/Cmd + Z - Undo
  • Ctrl/Cmd + Shift + Z - Redo
  • Ctrl/Cmd + S - Save workflow
  • Ctrl/Cmd + E - Execute workflow

Persistence

Save and load workflows:

Monaco Editor Integration

Work in Progress: Monaco JSON editor integration is under development for dual-mode editing (visual + code).
Planned features:
  • Side-by-side visual and JSON editing
  • Real-time sync between modes
  • JSON schema validation
  • Syntax highlighting

Best Practices

Use descriptive labels and categories to help users find nodes.
Show user-friendly error messages when execution fails.
Implement auto-save to prevent data loss.
Validate workflows before execution and show validation errors.
Show execution progress and node states during workflow execution.

Example Projects

Check out complete example projects in the repository:
  • Simple Math Workflow - Basic arithmetic operations
  • Data Processing Pipeline - Fetch, filter, transform data
  • API Integration - HTTP requests and response handling

Next Steps

WorkflowBuilder API

Complete WorkflowBuilder reference

React Hooks

All available React hooks

Component API

Individual component docs

Examples

View complete examples