行ってしまっていた

had already left

→ 行く
phrase Rare #36,341
had already left しまう emphasizes that the departure was completed; depending on context, it can also suggest regret or that the result was unfortunate.
JA: 着いたときには、友達はもう行ってしまっていた。
EN: By the time I arrived, my friend had already left.

私が停留所に着いたときには、最終バスはもう行ってしまっていた。

By the time I got to the bus stop, the last bus had already left.

当時は外国へ行ってしまっていたのを知らなかったのですか。

Didn't you know that they had gone abroad by then?

駅へ着いた時、彼の乗る列車は行ってしまっていた。

When he arrived at the station, the train he was supposed to take had already left.