diff --git a/lib/galaxy/workflow/refactor/schema.py b/lib/galaxy/workflow/refactor/schema.py index b5b62553e55..a4ca1800242 100644 --- a/lib/galaxy/workflow/refactor/schema.py +++ b/lib/galaxy/workflow/refactor/schema.py @@ -241,7 +241,14 @@ union_action_classes = Union[ ACTION_CLASSES_BY_TYPE = {} for action_class in union_action_classes.__args__: # type: ignore - action_type = action_class.schema()["properties"]["action_type"]["const"] + action_type_def = action_class.schema()["properties"]["action_type"] + try: + # pydantic 1.8 + action_type = action_type_def["enum"][0] + except KeyError: + # pydantic 1.7 + action_type = action_type_def["const"] + ACTION_CLASSES_BY_TYPE[action_type] = action_class