fix: update progress callback and event types for workflow execution
- Changed progress callback from "execution_complete" to "workflow_graph_finished" to provide intermediate updates. - Updated documentation to clarify the distinction between "workflow_graph_finished" and "execution_complete". - Adjusted frontend API handling to accommodate new event structure and ensure proper result serialization.
This commit is contained in:
1 parent
a002781ef9
commit
0ad3ddd627
3 files changed
+30
-14
No files matched your search
@@ -275,7 +275,8 @@ async def execute_unified_prompt_stream(
|
||||
Returns live progress updates during workflow execution:
|
||||
- execution_started: Workflow has begun
|
||||
- node_complete: Each node completes
|
||||
- execution_complete: Final result ready
|
||||
- workflow_graph_finished: Workflow-Graph fertig (Zwischen-Info, kein Endergebnis)
|
||||
- execution_complete: Endergebnis (wie POST /execute, Feld result)
|
||||
- execution_failed: Error occurred
|
||||
|
||||
Use this endpoint for long-running workflows (>30s) to avoid gateway timeouts.
|
||||
@@ -364,6 +365,20 @@ async def execute_unified_prompt_stream(
|
||||
)
|
||||
conn.commit()
|
||||
|
||||
# Pflicht für alle Prompt-Typen: Pipeline/Base rufen keinen progress_callback
|
||||
# mit Abschluss auf — ohne dieses Event endet SSE ohne resolve → „Connection to server lost“.
|
||||
try:
|
||||
sse_payload = json.loads(json.dumps(result, default=str))
|
||||
except (TypeError, ValueError):
|
||||
sse_payload = {
|
||||
"type": result.get("type", "unknown"),
|
||||
"error": "result_not_serializable",
|
||||
}
|
||||
await event_queue.put({
|
||||
"type": "execution_complete",
|
||||
"result": sse_payload,
|
||||
})
|
||||
|
||||
except Exception as e:
|
||||
# Queue error event
|
||||
await event_queue.put({
|
||||
|
||||
Reference in new issue
Block a user