fix: Workflow execute - prompt_id → prompt_slug
**Problem:** Execute-Button funktionierte, aber Ausführung scheiterte mit "Prompt not found: none" im Analysis Node. **Root Cause:** Mismatch zwischen Frontend (speicherte prompt_id/UUID) und Backend (erwartete prompt_slug/String). Backend WorkflowNode Model (workflow_models.py:193): prompt_slug: Optional[str] = Field(...) **Änderungen:** - WorkflowEditorPage.jsx: Dropdown auf slug umgestellt - value: prompt_slug statt prompt_id - onChange: selectedPrompt.slug statt .id - handleNodeUpdate: prompt_slug speichern - workflowSerializer.js: Serialization/Deserialization - Serialize: prompt_slug statt prompt_id - Deserialize: node.prompt_slug lesen **Testing:** - Workflow mit Analysis Node neu erstellen - Execute-Button sollte jetzt funktionieren Part 2 Bugfix - Workflow Execution Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
46d39bad38
commit
af7c5ca55a
|
|
@ -426,14 +426,14 @@ export default function WorkflowEditorPage() {
|
||||||
<div className="config-section">
|
<div className="config-section">
|
||||||
<label>KI-Prompt auswählen</label>
|
<label>KI-Prompt auswählen</label>
|
||||||
<select
|
<select
|
||||||
value={selectedNode.data.prompt_id ? String(selectedNode.data.prompt_id) : ''}
|
value={selectedNode.data.prompt_slug ? String(selectedNode.data.prompt_slug) : ''}
|
||||||
onChange={(e) => {
|
onChange={(e) => {
|
||||||
const promptId = e.target.value
|
const promptSlug = e.target.value
|
||||||
console.log('🎯 Prompt selected:', promptId, 'Type:', typeof promptId)
|
console.log('🎯 Prompt selected:', promptSlug, 'Type:', typeof promptSlug)
|
||||||
const selectedPrompt = availablePrompts.find(p => String(p.id) === promptId)
|
const selectedPrompt = availablePrompts.find(p => p.slug === promptSlug)
|
||||||
console.log('📋 Selected prompt object:', selectedPrompt)
|
console.log('📋 Selected prompt object:', selectedPrompt)
|
||||||
handleNodeUpdate(selectedNode.id, {
|
handleNodeUpdate(selectedNode.id, {
|
||||||
prompt_id: promptId || null, // UUID as string, no parseInt!
|
prompt_slug: promptSlug || null,
|
||||||
prompt_name: selectedPrompt?.name || null
|
prompt_name: selectedPrompt?.name || null
|
||||||
})
|
})
|
||||||
}}
|
}}
|
||||||
|
|
@ -448,14 +448,14 @@ export default function WorkflowEditorPage() {
|
||||||
>
|
>
|
||||||
<option value="">-- Basis-Prompt wählen --</option>
|
<option value="">-- Basis-Prompt wählen --</option>
|
||||||
{availablePrompts.map(prompt => (
|
{availablePrompts.map(prompt => (
|
||||||
<option key={prompt.id} value={String(prompt.id)}>
|
<option key={prompt.id} value={prompt.slug}>
|
||||||
{prompt.name}
|
{prompt.name}
|
||||||
</option>
|
</option>
|
||||||
))}
|
))}
|
||||||
</select>
|
</select>
|
||||||
{selectedNode.data.prompt_id && (
|
{selectedNode.data.prompt_slug && (
|
||||||
<div style={{ marginTop: 8, fontSize: 12, color: 'var(--text3)' }}>
|
<div style={{ marginTop: 8, fontSize: 12, color: 'var(--text3)' }}>
|
||||||
Prompt ID: {selectedNode.data.prompt_id} ({selectedNode.data.prompt_name || 'unbekannt'})
|
Prompt: {selectedNode.data.prompt_slug} ({selectedNode.data.prompt_name || 'unbekannt'})
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ export function serializeToWorkflowGraph(nodes, edges, metadata = {}) {
|
||||||
|
|
||||||
// Type-spezifische Felder
|
// Type-spezifische Felder
|
||||||
...(node.type === 'analysis' && {
|
...(node.type === 'analysis' && {
|
||||||
prompt_id: node.data.prompt_id || null,
|
prompt_slug: node.data.prompt_slug || null,
|
||||||
prompt_name: node.data.prompt_name || null,
|
prompt_name: node.data.prompt_name || null,
|
||||||
questions: node.data.questions || [],
|
questions: node.data.questions || [],
|
||||||
fallback_strategy: node.data.fallback_strategy || 'conservative_skip'
|
fallback_strategy: node.data.fallback_strategy || 'conservative_skip'
|
||||||
|
|
@ -78,7 +78,7 @@ export function deserializeFromWorkflowGraph(jsonbData) {
|
||||||
label: node.label,
|
label: node.label,
|
||||||
|
|
||||||
...(node.type === 'analysis' && {
|
...(node.type === 'analysis' && {
|
||||||
prompt_id: node.prompt_id,
|
prompt_slug: node.prompt_slug,
|
||||||
prompt_name: node.prompt_name || null, // Falls vom Backend mitgeliefert
|
prompt_name: node.prompt_name || null, // Falls vom Backend mitgeliefert
|
||||||
questions: node.questions || [],
|
questions: node.questions || [],
|
||||||
fallback_strategy: node.fallback_strategy || 'conservative_skip'
|
fallback_strategy: node.fallback_strategy || 'conservative_skip'
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user