Offline programs are persistent on the robot and callable using their respective program number. You can automate the program number selection by adding it to the program name.
RoboDK will automatically retrieve the ID and use it to call the program. This also applies to subroutines, see the example below.