Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

Fix if_else node compatibility with historical workflows. (#6186)

JasonVV0e82072323fa
diff --git a/api/core/workflow/nodes/if_else/if_else_node.py b/api/core/workflow/nodes/if_else/if_else_node.py
index 95927d11e3f..6176a752014 100644
--- a/api/core/workflow/nodes/if_else/if_else_node.py
+++ b/api/core/workflow/nodes/if_else/if_else_node.py
@@ -60,6 +60,8 @@ class IfElseNode(BaseNode):
final_result = all(group_result) if node_data.logical_operator == "and" else any(group_result)
+ selected_case_id = "true" if final_result else "false"
+
process_datas["condition_results"].append(
{
"group": "default",
@@ -78,11 +80,7 @@ class IfElseNode(BaseNode):
error=str(e)
)
- outputs = {
- "result": final_result
- }
- if node_data.cases:
- outputs["selected_case_id"] = selected_case_id
+ outputs = {"result": final_result, "selected_case_id": selected_case_id}
data = NodeRunResult(
status=WorkflowNodeExecutionStatus.SUCCEEDED,