def _validate_entity_node_edges(dag: schemas.SyncDag, entity_node: schemas.DagNode) -> None:
    """Validate that entity node has exactly one outgoing edge."""
    edges_from_entity_node = dag.get_edges_from_node(entity_node.id)
    if not edges_from_entity_node:
        raise HTTPException(
            status_code=400, detail=f"Entity node '{entity_node.name}' has no outgoing edges"
        )
    if len(edges_from_entity_node) > 1:
        raise HTTPException(
            status_code=400,
            detail=(
                f"Entity node '{entity_node.name}' has more than one outgoing edge. "
                f"Only one destination is allowed."
            ),
        )
Validate that entity node has exactly one outgoing edge.
backend/airweave/api/v1/endpoints/dag.py