this can be done, however, you need to provide them with a home that they dont want to leave, so it needs to be big enough to support a big colony, and safe
one way of doing it wuld be to use a farm, and have a very long piece of tubing connected that goes out of a window for them to forage, block the entrance of the tube (at the farm end) so that only workers can get out and not the queen.
I had sum success with this a few years ago
I wuld recomend letting the colony grow and establish for a year tho before you let them outside