for example:
set interface ethernet eth0 address 192.168.1.100/24
set interface ethernet eth1 address 10.10.10.100/24
set protocol static route 192.168.10.0/24 next-hop 192.168.1.1 bfd 192.168.1.1(*)
set protocol static route 192.168.10.0/24 next-hop 10.10.10.1 distance 120
set bfd profile BFD-HQ timeout-ms 300
set bfd peer 192.168.1.1 profile BFD-HQ
in this case, route (*) is active only when 192.168.1.1 is reachable.