A visual workflow automation builder inspired by ActivePieces, built with React, TypeScript, and React Flow (@xyflow/react).
- ActivePieces-Inspired Architecture - Graph-based workflow representation with recursive building
- Visual Workflow Creation - Drag-free interface with automatic node alignment
- Smart Edge Controls - Inline plus buttons for easy node insertion via step selector popup
- Router Support - Create branching workflows with conditional logic
- Automatic Graph Layout - Vertical alignment with proper spacing and offset calculations
- Step Selector Popup - Beautiful UI for selecting from various integrations and actions
- TypeScript Support - Full type safety with enums and strict typing
- Graph-Based State - Efficient workflow representation using FlowVersion and ApGraph structures
workflow/
βββ src/
β βββ components/ # React components
β β βββ nodes/ # ActivePieces-style node components
β β β βββ ApStepNode.tsx # Main workflow step node
β β β βββ ApBigAddButtonNode.tsx # Large add button for branches
β β β βββ ApGraphEndNode.tsx # Graph end widget
β β βββ edges/ # Custom edge components
β β β βββ ApStraightLineEdge.tsx # Straight edges with add buttons
β β β βββ CustomEdge.tsx # Legacy edge (minimal)
β β βββ WorkflowCanvas.tsx # Main canvas with React Flow
β β βββ WorkflowHeader.tsx # Header with flow name
β β βββ StepSelector.tsx # Step selector popup UI
β β βββ StepSelectorHandler.tsx # Step selector logic
β βββ context/ # State management
β β βββ WorkflowContext.tsx # Graph-based workflow state
β βββ types/ # TypeScript definitions
β β βββ workflow.types.ts # ActivePieces-style types
β βββ utils/ # Utility functions
β β βββ graphUtils.ts # Graph building and manipulation
β β βββ flowConstants.ts # Constants and dimensions
β β βββ reactFlowConverter.ts # ApGraph to React Flow converter
β β βββ cn.ts # className utility
β βββ App.tsx # Main application
β βββ main.tsx # Entry point
βββ docs/ # Documentation
β βββ README.md # Docs overview
β βββ activepieces-analysis.md # ActivePieces implementation notes
β βββ screenshots/ # UI reference images
βββ package.json
- Node.js 18+
- npm or yarn
# Clone the repository
git clone <repository-url>
cd workflow
# Install dependencies
npm install
# Start development server
npm run devOpen http://localhost:5173 in your browser.
- Documentation Index - All documentation
- ActivePieces Analysis - Implementation patterns from ActivePieces
import { useWorkflow } from './context/WorkflowContext'
import { FlowActionType } from './types/workflow.types'
function MyWorkflow() {
const { flowVersion, addAction, openStepSelectorForStep } = useWorkflow()
// Add a new action to the workflow
const handleAddAction = () => {
const newAction = {
name: `step-${Date.now()}`,
displayName: 'Send Email',
type: FlowActionType.PIECE,
settings: {
pieceName: 'gmail',
actionName: 'send-email',
},
}
// Add after the trigger
addAction('trigger', newAction)
}
// Or open the step selector popup
const handleOpenSelector = () => {
openStepSelectorForStep('trigger', { x: 500, y: 300 })
}
return <WorkflowCanvas />
}- Graph-Based State - Workflows are represented as FlowVersion with recursive graph structure
- Node Types:
ApStepNode- Represents triggers and actions in the workflowApBigAddButtonNode- Large add button for empty branchesApGraphEndNode- Invisible end widget for graph calculations
- Edge Types:
ApStraightLineEdge- Straight lines with inline add buttons
- Flow Actions:
CODE- Custom code executionPIECE- Integration actions (Gmail, Slack, etc.)ROUTER- Conditional branchingLOOP_ON_ITEMS- Loop operations
- Recursive Construction - Each step builds its own graph and child graphs
- Automatic Positioning - Nodes positioned with proper offsets and spacing
- Branch Management - Router nodes create multiple branches with proper layout
- Edge Creation - Automatic edge generation between sequential steps
- Every workflow starts with one trigger
- Nodes are positioned at x=400px with automatic vertical spacing
- Add new steps via the plus button on edges
- Router nodes create 4 branches (3 conditional + 1 otherwise)
- Graph end widgets manage proper flow termination
npm run dev # Start development server
npm run build # Build for production
npm run preview # Preview production build
npm run lint # Run ESLint
npm run type-check # Run TypeScript compiler- React 18.3 - UI framework
- TypeScript 5.6 - Type safety
- @xyflow/react 12.3 - Flow visualization
- Vite 6.0 - Build tooling
- Context API - State management
- Inspired by ActivePieces
- Built with React Flow
- Icons from Simple Icons
- π§ Email: your-email@example.com
- π¬ Discord: Join our community
- π Documentation: View full docs
Made with β€οΈ by Thuta