Skip to content

Commit edc70ee

Browse files
author
Alan Christie
committed
fix: Better handling of lack of outputs
1 parent aca2891 commit edc70ee

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

workflow/workflow_engine.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -737,12 +737,23 @@ def _prepare_step(
737737
output_variable=connector.in_,
738738
)
739739
)
740+
_LOGGER.info(
741+
"API.get_running_workflow_step_output_values_for_output() got %s\n",
742+
str(result),
743+
)
740744
iter_values = result["output"].copy()
741745
break
742746
# Stop if we've got an iteration variable
743747
if iter_variable:
744748
break
745749

750+
# If we've set an iteration variable we should have at least one value.
751+
# If not we cannot continue.
752+
if iter_variable and len(iter_values) == 0:
753+
msg = f"The step prior to step '{step_name}' had no outputs. At least one is needed"
754+
_LOGGER.warning(msg)
755+
return StepPreparationResponse(replicas=0, error_num=5, error_msg=msg)
756+
746757
# Get the list of instances we depend upon.
747758
#
748759
# We need to do this so that the launcher can hard-link

0 commit comments

Comments
 (0)