Generally we recommend writing your tasks as functions that do a thing, and providing tasks they need to know about as arguments to those functions. Having a task know about another task that isn't a direct dependency is generally an antipattern in prefect. Can you go into more about why you want this behavior? There may be a cleaner way to implement what you want here using patterns that are native to prefect.