From d3161fffe53d675b02dbf8552b8995e926ef31ff Mon Sep 17 00:00:00 2001 From: -LAN- Date: Fri, 3 Jan 2025 16:04:53 +0800 Subject: [PATCH] fix: ensure workflow node executions are tracked after addition to session Signed-off-by: -LAN- --- api/core/app/task_pipeline/workflow_cycle_manage.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/api/core/app/task_pipeline/workflow_cycle_manage.py b/api/core/app/task_pipeline/workflow_cycle_manage.py index ed24b418bd46cb..4208d4f739bffb 100644 --- a/api/core/app/task_pipeline/workflow_cycle_manage.py +++ b/api/core/app/task_pipeline/workflow_cycle_manage.py @@ -307,6 +307,8 @@ def _handle_node_execution_start( workflow_node_execution.created_at = datetime.now(UTC).replace(tzinfo=None) session.add(workflow_node_execution) + + self._workflow_node_executions[workflow_node_execution.id] = workflow_node_execution return workflow_node_execution def _handle_workflow_node_execution_success( @@ -424,6 +426,8 @@ def _handle_workflow_node_execution_retried( workflow_node_execution.index = event.node_run_index session.add(workflow_node_execution) + + self._workflow_node_executions[workflow_node_execution.id] = workflow_node_execution return workflow_node_execution #################################################