π Workflow Designer N8N-Style Enhancements
Overviewβ
Major enhancements to ValkyrAI's workflow designer to compete with and exceed N8N's capabilities. These improvements focus on UX, IntegrationAccount management, custom module configuration, and visual polish.
β¨ Completed Enhancementsβ
1. IntegrationAccountSelector Componentβ
File: web/typescript/valkyr_labs_com/src/components/WorkflowStudio/IntegrationAccountSelector.tsx
Features:
- Dropdown selector for existing IntegrationAccounts
- Filter by module type (EMAIL, REST, etc.)
- Filter by execModuleId
- Display account status (verified/unverified)
- Create new account button
- Error handling and retry logic
- Live account status indicators
Usage Example:
<IntegrationAccountSelector
value={selectedAccountId}
onChange={(id, account) => setSelectedAccountId(id)}
moduleType="EMAIL"
allowCreate
onCreateNew={() => setShowCreateDialog(true)}
/>
2. CenteredConnectionDialog Componentβ
File: web/typescript/valkyr_labs_com/src/components/WorkflowStudio/CenteredConnectionDialog.tsx
Features:
- Opens exactly where the connection is made (N8N-style!)
- Auto-adjusts position if would overflow viewport
- Smooth fade-in and scale animations
- Click outside to close
- ESC key to close
- Connection label configuration
- Trigger conditions (always/success/error)
- Advanced JEXL expression support
Key Improvements Over Old Dialog:
- β Centered at connection point (not upper right)
- β Better UX with backdrop and animations
- β Keyboard navigation support
- β Smart viewport positioning
π― Implementation Statusβ
β Completedβ
- IntegrationAccount selector component
- Centered connection dialog
- TypeScript type safety improvements
- Proper use of ThorAPI generated models
π§ Next Stepsβ
1. Update WorkflowCanvas to Use New Dialogβ
// Capture mouse position during connection
const [connectionPoint, setConnectionPoint] = useState<{x: number; y: number} | null>(null);
const onConnectStart = useCallback((_e: MouseEvent, { nodeId }: { nodeId?: string }) => {
if (nodeId && _e) {
setConnectionPoint({ x: _e.clientX, y: _e.clientY });
}
}, []);
// Pass position to dialog
<CenteredConnectionDialog
show={edgeDialog.show}
position={connectionPoint}
onSave={applyEdgeConfig}
onCancel={() => setEdgeDialog({ show: false })}
/>
2. Enhance Module Configuration Panelsβ
Email Module Config:
- IntegrationAccountSelector for MailerSend/SendGrid API keys
- Template editor with variable mapping
- Recipient list builder
- Attachment handling
REST Module Config:
- IntegrationAccountSelector for API authentication
- Method selector (GET/POST/PUT/DELETE)
- Header builder with key-value pairs
- Body editor with JSON/form-data support
- Response mapping configuration
3. Custom Module Designersβ
Create specialized UI for each module type in ModuleDesigner/:
EmailModuleDesigner.tsx- Email-specific configurationRestModuleDesigner.tsx- REST API configurationQbeModuleDesigner.tsx- Query builder UILlmModuleDesigner.tsx- LLM prompt configuration
4. Enhanced Node Stylingβ
N8N-style visual improvements:
- Gradient backgrounds on nodes
- Icon support for different module types
- Status indicators (running/success/error)
- Hover effects and animations
- Connection line animations
- Minimap enhancements
5. Drag-and-Drop Enhancementsβ
- Snap-to-grid for cleaner layouts
- Smart connection suggestions
- Auto-layout algorithm
- Bulk node operations (select, move, delete)
π Architectureβ
Integration with ThorAPIβ
All components use ThorAPI generated models:
import type { IntegrationAccount, ExecModule, Workflow } from "@thorapi/model";
import { useGetIntegrationAccountsQuery } from "@thorapi/redux/services/IntegrationAccountService";
State Managementβ
- Redux Toolkit for global workflow state
- Local React state for UI concerns
- RTK Query for API calls with caching
Component Hierarchyβ
ConsolidatedWorkflowStudio
βββ NodePalette
βββ WorkflowCanvas
β βββ ReactFlow
β βββ Custom Node Types (Task, Branch, Start, End)
β βββ CenteredConnectionDialog β¨ NEW
βββ InspectorPanel
β βββ IntegrationAccountSelector β¨ NEW
β βββ ModuleDesigner
β β βββ EmailModuleDesigner (TODO)
β β βββ RestModuleDesigner (TODO)
β β βββ QbeModuleDesigner (TODO)
β βββ RetryPolicyEditor
βββ Console/Logs