From 7cbaef6d68410fb7190a213e34e60997538c9118 Mon Sep 17 00:00:00 2001 From: liuzhenghua <1090179900@qq.com> Date: Fri, 10 Jan 2025 05:01:27 +0000 Subject: [PATCH] fix #12592 --- api/core/workflow/graph_engine/graph_engine.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/api/core/workflow/graph_engine/graph_engine.py b/api/core/workflow/graph_engine/graph_engine.py index db1e01f14fda59..6ae61b0d508ad9 100644 --- a/api/core/workflow/graph_engine/graph_engine.py +++ b/api/core/workflow/graph_engine/graph_engine.py @@ -430,7 +430,13 @@ def _run( next_node_id = final_node_id if in_parallel_id and self.graph.node_parallel_mapping.get(next_node_id, "") != in_parallel_id: - break + source_edges = self.graph.reverse_edge_mapping.get(next_node_id, []) + source_node_ids = {edge.source_node_id for edge in source_edges} + if len(source_node_ids) == 1: + # if -> node1, node2, else -> node2. the current path follows the else branch. + in_parallel_id = self.graph.node_parallel_mapping.get(next_node_id, "") + else: + break def _run_parallel_branches( self,