async def METHOD_NAME(
    exclude: Optional[Set[str]] = None,
) -> List[RelatedResource]:
    from prefect.client.orchestration import get_client
    from prefect.context import FlowRunContext, TaskRunContext
    if exclude is None:
        exclude = set()
    flow_run_context = FlowRunContext.get()
    task_run_context = TaskRunContext.get()
    if not flow_run_context and not task_run_context:
        return []
    flow_run_id: UUID = (
        flow_run_context.flow_run.id
        if flow_run_context
        else task_run_context.task_run.flow_run_id
    )
    related_objects: list[ResourceCacheEntry] = []
    async with get_client() as client:
        async def dummy_read():
            return {}
        if flow_run_context:
            related_objects.append(
                {
                    "kind": "flow-run",
                    "role": "flow-run",
                    "object": flow_run_context.flow_run,
                },
            )
        else:
            related_objects.append(
                await _get_and_cache_related_object(
                    kind="flow-run",
                    role="flow-run",
                    client_method=client.read_flow_run,
                    obj_id=flow_run_id,
                    cache=RESOURCE_CACHE,
                )
            )
        if task_run_context:
            related_objects.append(
                {
                    "kind": "task-run",
                    "role": "task-run",
                    "object": task_run_context.task_run,
                },
            )
        flow_run = related_objects[0]["object"]
        if flow_run:
            related_objects += list(
                await asyncio.gather(
                    _get_and_cache_related_object(
                        kind="flow",
                        role="flow",
                        client_method=client.read_flow,
                        obj_id=flow_run.flow_id,
                        cache=RESOURCE_CACHE,
                    ),
                    (
                        _get_and_cache_related_object(
                            kind="deployment",
                            role="deployment",
                            client_method=client.read_deployment,
                            obj_id=flow_run.deployment_id,
                            cache=RESOURCE_CACHE,
                        )
                        if flow_run.deployment_id
                        else dummy_read()
                    ),
                    (
                        _get_and_cache_related_object(
                            kind="work-queue",
                            role="work-queue",
                            client_method=client.read_work_queue,
                            obj_id=flow_run.work_queue_id,
                            cache=RESOURCE_CACHE,
                        )
                        if flow_run.work_queue_id
                        else dummy_read()
                    ),
                    (
                        _get_and_cache_related_object(
                            kind="work-pool",
                            role="work-pool",
                            client_method=client.read_work_pool,
                            obj_id=flow_run.work_pool_name,
                            cache=RESOURCE_CACHE,
                        )
                        if flow_run.work_pool_name
                        else dummy_read()
                    ),
                )
            )
    related = []
    tags = set()
    for entry in related_objects:
        obj_ = entry.get("object")
        if obj_ is None:
            continue
        assert isinstance(entry["kind"], str) and isinstance(entry["role"], str)
        resource = object_as_related_resource(
            kind=entry["kind"], role=entry["kind"], object=obj_
        )
        if resource.id in exclude:
            continue
        related.append(resource)
        if hasattr(obj_, "tags"):
            tags |= set(obj_.tags)
    related += [
        resource
        for resource in tags_as_related_resources(tags)
        if resource.id not in exclude
    ]
    return related