An event-driven workflow designer for HR-style processes. Build flows with draggable nodes, configure them, simulate execution with live node status, and manage multiple pages of workflows.
pnpm install # or npm install / yarn
pnpm dev # starts Vite dev serverOpen the printed localhost URL to use the designer.
- Drag-and-drop workflow nodes: Start, Task, Approval, Automated, End.
- Live simulation with animated steps and per-node runtime status badges (running/completed/failed).
- Export/import workflow JSON.
- Validation for required Start/End nodes and connectivity.
- Multi-page support: create a new page, which clears the canvas and simulation history.
- Clear/reset simulation window and results independently of canvas clear.
- UI built with shadcn components and Tailwind.
src/main.tsx: Entrypoint; rendersAppand global providers.src/App.tsx: Router + React Query + Toaster providers.src/pages/Index.tsx: Hosts theWorkflowCanvas.src/hooks/useWorkflow.ts: State/store for nodes, edges, CRUD, validation, import/export, and clear.src/components/workflow/WorkflowCanvas.tsx: Main layout (palette, canvas, config, simulation), React Flow wiring, page creation/reset, and node status injection.src/components/workflow/NodePalette.tsx: Draggable palette of node types.src/components/workflow/NodeConfigPanel.tsx+forms/*: Node configuration forms.src/components/workflow/SimulationPanel.tsx: Simulation controls, validation display, status/reset buttons, export/import, and stats.src/components/workflow/nodes/*: Custom node renderers with status badges.src/lib/mockApi.ts: Mocked automation actions and workflow simulation engine.src/types/workflow.ts: Types for nodes, edges, simulation, validation, and runtime status.
- Drag node from palette → canvas drop:
onDropinWorkflowCanvascreates a node viauseWorkflow.addNode. - Select node:
onNodeClicksetsselectedNode;NodeConfigPanelrenders the matching form. - Edit node: Form updates call
useWorkflow.updateNodeData, refreshing React Flow nodes. - Connect nodes: React Flow
onConnectadds animated edges. - Validate:
useWorkflow.validateWorkflowchecks Start/End presence and connectivity; warnings/errors show inSimulationPanel. - Simulate:
SimulationPanel.runSimulationcallsmockApi.simulateWorkflow. Steps emitrunningthencompletedtoonStepChange, updating node badges live. - Reset/Clear:
- Reset results: clears simulation progress/status without touching nodes.
- Clear canvas: removes nodes/edges and resets status.
- New page: clears canvas, resets simulation state, bumps page name.
- Export/Import:
onExport/onImportserialize or load{ nodes, edges }JSON.
- Tailwind with CSS variables for node theme colors.
- shadcn UI (button, dialog, badge, input, etc.).
- React Flow for the canvas, minimap, controls, background grid.
- Build a minimal valid flow (Start → Task → End); simulate and see running/completed badges.
- Remove Start node; verify validation error blocks simulation.
- Create a second page via “New”; confirm canvas and simulation panel are fresh.
- Import an exported JSON; nodes and edges should restore.