**Issue 1: Prompt selector loses value** - When switching Reference→Inline→Reference, the dropdown was empty - Root cause: Switching to Inline deleted prompt_slug - Fix: Keep prompt_slug when activating inline_template - Now: Both modes preserve their values independently **Issue 2: Workflow overview shows 'kein Prompt'** - Nodes with inline templates showed misleading 'kein Prompt' text - Root cause: AnalysisNode only checked prompt_name/prompt_slug - Fix: Check inline_template and display '✏️ Inline-Template' - Now: Clear visual distinction between modes Files: - WorkflowEditorPage.jsx: Preserve prompt_slug on mode switch - AnalysisNode.jsx: Add isInlineMode detection and display Part 3: Inline Prompts - UX polish
**Remaining Issues Found:** 1. Validierung prüfte noch prompt_id → Speichern blockiert 2. AnalysisNode zeigte noch prompt_id → "Kein Prompt" obwohl gesetzt 3. Deserializer hatte keinen Fallback für alte Workflows **Fixes:** - workflowValidation.js: Line 91 - if (!node.data.prompt_slug) statt prompt_id - AnalysisNode.jsx: Line 15 - Verwendet jetzt data.prompt_slug - Fallback: "Prompt: ${slug}" statt "Prompt #${id}" - Kommentar aktualisiert (data.prompt_slug statt prompt_id) - workflowSerializer.js: Line 81 - Fallback: node.prompt_slug || node.prompt_id || null - Backwards-compatible für alte Workflows **Testing:** 1. Neuen Workflow erstellen 2. Analysis Node hinzufügen 3. Prompt auswählen 4. Node sollte Prompt-Namen zeigen 5. Beim Öffnen: Dropdown sollte Wert anzeigen 6. Speichern sollte funktionieren (keine Validierungsfehler) 7. Execute sollte funktionieren (kein "Prompt not found") Part 2 Complete Bugfix - Workflow Execution Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Backend (Mini-Backend 1-2h): - Migration 016: ai_prompts.graph_data JSONB column - workflow_executor: graph_data parameter support (backward-compatible) - prompt_executor: execute_workflow_prompt uses graph_data Frontend (Main effort 25-35h): - WorkflowCanvas: React Flow wrapper component - 5 Custom Nodes: Start, End, Analysis, Logic, Join - 4 Config Panels: QuestionAugmentation, LogicExpression, Fallback, Join - workflowValidation: Structural + logical validation - workflowSerializer: Canvas ↔ JSONB conversion - WorkflowEditorPage: Main orchestration (420 LOC) - Route: /workflow-editor/:id - CSS: workflowEditor.css (300 LOC) Architecture: - Option B: ai_prompts.type='workflow' (not separate table) - panels/ subdirectory for clean separation - WorkflowCanvas reusable component - User GUI identical (Workflows = Prompts) - Backward-compatible (type='pipeline' unchanged) Version: v0.9m → v0.9n (Phase 5 complete) Module: workflow 0.5.0 → 0.6.0 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>