diff --git a/backend/workflow_executor.py b/backend/workflow_executor.py index 809b40a..1833e9f 100644 --- a/backend/workflow_executor.py +++ b/backend/workflow_executor.py @@ -216,6 +216,7 @@ async def execute_workflow( "execution_id": execution_id, "status": "completed", "aggregated_result": aggregated, + "node_states": [ns.model_dump() for ns in node_states], # Serialize Pydantic models "total_nodes": len(node_states), "completed_nodes": len([ns for ns in node_states if ns.status == NodeStatus.EXECUTED]), "skipped_nodes": len([ns for ns in node_states if ns.status == NodeStatus.SKIPPED]), @@ -238,12 +239,16 @@ async def execute_workflow( # NEW: Progress-Callback für Fehler if progress_callback: - await progress_callback("execution_failed", { + error_data = { "execution_id": execution_id, "status": "failed", "error": str(e), "completed_at": datetime.utcnow().isoformat() - }) + } + # Include node_states if available (to show partial progress) + if 'node_states' in locals() and node_states: + error_data["node_states"] = [ns.model_dump() for ns in node_states] + await progress_callback("execution_failed", error_data) # Speichere Failed State completed_at = datetime.utcnow().isoformat()