diff --git a/lib/galaxy/tools/actions/__init__.py b/lib/galaxy/tools/actions/__init__.py index dc1a8f699db5..50563eb55bcf 100644 --- a/lib/galaxy/tools/actions/__init__.py +++ b/lib/galaxy/tools/actions/__init__.py @@ -699,7 +699,7 @@ def handle_output(name, output, hidden=None): ) # Add all the top-level (non-child) datasets to the history unless otherwise specified for name, data in out_data.items(): - if name not in incoming and name not in child_dataset_names: + if getattr(data, "hid", None) is None or (name not in incoming and name not in child_dataset_names): # don't add already existing datasets, i.e. async created history.stage_addition(data) history.add_pending_items(set_output_hid=set_output_hid)