code: def _get_validated_stages(stages):
      
      if not isinstance(stages, list):
          raise WorkflowBuilderException("Stages must be specified as a list of dictionaries")
      validated_stages = []
      for index, stage in enumerate(stages):
          validated_stages.append(_get_validated_stage(stage, index))
      return validated_stages
docs: Validates stages of the workflow as a list of dictionaries.