"""Aggregation SWF Workflows.""" import importlib __all__ = ( 'spotify_sos', 'apple_music_sos', 'apple_music_demographics', 'spotify_demographics', 'amazon_unlimited_sos') def get_flow(flow_name): """Get flow by flow name. Args: flow_name (str): Name of the workflow. Returns: Flow: Flow object for the particular flow name. """ flow = importlib.import_module('.{}.flow'.format(flow_name), __name__) # look for the flow class, if it exists, otherwise fall back # on the flow module itself. flow_class = getattr(flow, 'Flow', None) if flow_class: flow = flow_class() return flow