def collective_downstream(workflow, steps): downstream = set() for step in steps: for x in nx.descendants(workflow.dag, step): downstream.add(x) return list(downstream)