diff --git a/lib/galaxy/model/__init__.py b/lib/galaxy/model/__init__.py
index 9843696f0db8..1dd75cee6309 100644
--- a/lib/galaxy/model/__init__.py
+++ b/lib/galaxy/model/__init__.py
@@ -7616,7 +7616,7 @@ class StoredWorkflow(Base, HasTags, Dictifiable, RepresentById, UsesCreateAndUpd
         order_by=lambda: -Workflow.id,
         cascade_backrefs=False,
     )
-    latest_workflow = relationship(
+    latest_workflow: Mapped["Workflow"] = relationship(
         "Workflow",
         post_update=True,
         primaryjoin=(lambda: StoredWorkflow.latest_workflow_id == Workflow.id),
@@ -7722,7 +7722,7 @@ def show_in_tool_panel(self, user_id):
         )
         return bool(sa_session.scalar(stmt))
 
-    def copy_tags_from(self, target_user, source_workflow):
+    def copy_tags_from(self, target_user, source_workflow: "StoredWorkflow"):
         # Override to only copy owner tags.
         for src_swta in source_workflow.owner_tags:
             new_swta = src_swta.copy()
@@ -8239,9 +8239,9 @@ def copy_to(self, copied_step, step_mapping, user=None):
                 copied_subworkflow = subworkflow
             else:
                 # Can this even happen, building a workflow with a subworkflow you don't own ?
-                copied_subworkflow = subworkflow.copy()
+                copied_subworkflow = subworkflow.copy(user=user)
                 stored_workflow = StoredWorkflow(
-                    user, name=copied_subworkflow.name, workflow=copied_subworkflow, hidden=True
+                    user=user, name=copied_subworkflow.name, workflow=copied_subworkflow, hidden=True
                 )
                 copied_subworkflow.stored_workflow = stored_workflow
                 copied_step.subworkflow = copied_subworkflow
diff --git a/lib/galaxy/webapps/base/controller.py b/lib/galaxy/webapps/base/controller.py
index 83c3ae620560..4f5d85de86d1 100644
--- a/lib/galaxy/webapps/base/controller.py
+++ b/lib/galaxy/webapps/base/controller.py
@@ -1144,7 +1144,7 @@ def get_stored_workflow_steps(self, trans, stored_workflow: model.StoredWorkflow
             except exceptions.ToolMissingException:
                 pass
 
-    def _import_shared_workflow(self, trans, stored):
+    def _import_shared_workflow(self, trans, stored: model.StoredWorkflow):
         """Imports a shared workflow"""
         # Copy workflow.
         imported_stored = model.StoredWorkflow()