fix: Complete prompt_id → prompt_slug migration
All checks were successful
Deploy Development / deploy (push) Successful in 47s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 15s

**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>
This commit is contained in:
Lars 2026-04-09 15:39:11 +02:00
parent af7c5ca55a
commit 2994df54ad
3 changed files with 4 additions and 4 deletions

View File

@ -5,14 +5,14 @@ import { Handle, Position } from 'reactflow'
*
* Properties:
* - data.label: Node-Label
* - data.prompt_id: ID des referenzierten Basis-Prompts
* - data.prompt_slug: Slug des referenzierten Basis-Prompts
* - data.prompt_name: Name des Prompts (optional, für Display)
* - data.questions: Array von Question Augmentations
* - selected: Boolean
*/
export function AnalysisNode({ data, selected }) {
const hasQuestions = data.questions?.length > 0
const promptName = data.prompt_name || (data.prompt_id ? `Prompt #${data.prompt_id}` : 'Kein Prompt')
const promptName = data.prompt_name || (data.prompt_slug ? `Prompt: ${data.prompt_slug}` : 'Kein Prompt')
const questionCount = data.questions?.length || 0
return (

View File

@ -78,7 +78,7 @@ export function deserializeFromWorkflowGraph(jsonbData) {
label: node.label,
...(node.type === 'analysis' && {
prompt_slug: node.prompt_slug,
prompt_slug: node.prompt_slug || node.prompt_id || null, // Fallback für alte Workflows mit prompt_id
prompt_name: node.prompt_name || null, // Falls vom Backend mitgeliefert
questions: node.questions || [],
fallback_strategy: node.fallback_strategy || 'conservative_skip'

View File

@ -88,7 +88,7 @@ function validateLogic(nodes, edges, errors, warnings) {
const questions = node.data.questions || []
// Prompt ausgewählt?
if (!node.data.prompt_id) {
if (!node.data.prompt_slug) {
errors.push({
type: 'config',
message: `Analysis-Node "${node.data.label}" hat keinen Prompt`,