diff --git a/api/core/workflow/nodes/iteration/iteration_node.py b/api/core/workflow/nodes/iteration/iteration_node.py index b28ae0a85cf29..7503c13ce817a 100644 --- a/api/core/workflow/nodes/iteration/iteration_node.py +++ b/api/core/workflow/nodes/iteration/iteration_node.py @@ -46,6 +46,15 @@ def _run(self) -> Generator[NodeEvent | InNodeEvent, None, None]: if not iterator_list_segment: raise ValueError(f"Iterator variable {self.node_data.iterator_selector} not found") + if len(iterator_list_segment.value) == 0: + yield RunCompletedEvent( + run_result=NodeRunResult( + status=WorkflowNodeExecutionStatus.SUCCEEDED, + outputs={"output": []}, + ) + ) + return + iterator_list_value = iterator_list_segment.to_object() if not isinstance(iterator_list_value, list):