diff --git a/lib/galaxy/managers/workflows.py b/lib/galaxy/managers/workflows.py index 8ac7bd2fcbf..a9ad3764c32 100644 --- a/lib/galaxy/managers/workflows.py +++ b/lib/galaxy/managers/workflows.py @@ -458,10 +458,13 @@ class WorkflowContentsManager(UsesAnnotations): # workflow outputs outputs = [] - for output in step.workflow_outputs: - outputs.append({"output_name": output.output_name, - "uuid": str(output.uuid) if output.uuid else None, - "label": output.label}) + for output in step.unique_workflow_outputs: + output_label = output.label + output_name = output.output_name + output_uuid = str(output.uuid) if output.uuid else None + outputs.append({"output_name": output_name, + "uuid": output_uuid, + "label": output_label}) step_dict['workflow_outputs'] = outputs # Encode input connections as dictionary @@ -571,7 +574,7 @@ class WorkflowContentsManager(UsesAnnotations): # User outputs workflow_outputs_dicts = [] - for workflow_output in step.workflow_outputs: + for workflow_output in step.unique_workflow_outputs: workflow_output_dict = dict( output_name=workflow_output.output_name, label=workflow_output.label, diff --git a/lib/galaxy/model/__init__.py b/lib/galaxy/model/__init__.py index 881a8a7b01c..a101e7a9a38 100644 --- a/lib/galaxy/model/__init__.py +++ b/lib/galaxy/model/__init__.py @@ -3630,6 +3630,23 @@ class WorkflowStep( object ): self.workflow_outputs = [] self._input_connections_by_name = None + @property + def unique_workflow_outputs(self): + # Older Galaxy workflows may have multiple WorkflowOutputs + # per "output_name", when serving these back to the editor + # feed only a "best" output per "output_name."" + outputs = {} + for workflow_output in self.workflow_outputs: + output_name = workflow_output.output_name + + if output_name in outputs: + found_output = outputs[output_name] + if found_output.label is None and workflow_output.label is not None: + outputs[output_name] = workflow_output + else: + outputs[output_name] = workflow_output + return outputs.values() + @property def content_id( self ): content_id = None diff --git a/lib/galaxy/workflow/run.py b/lib/galaxy/workflow/run.py index 50f0e442164..6bad18648bc 100644 --- a/lib/galaxy/workflow/run.py +++ b/lib/galaxy/workflow/run.py @@ -177,7 +177,7 @@ class WorkflowInvoker( object ): ) raise - log.debug("Workflow step %s invoked %s" % (step.id, step_timer)) + log.debug("Workflow step %s of invocation %s invoked %s" % (step.id, workflow_invocation.id, step_timer)) if delayed_steps: state = model.WorkflowInvocation.states.READY