で働いてたんだ

was working at

→ で
phrase Rare #37,772
was working at A casual form of で働いていたんだ. The んだ adds an explanatory or emphatic tone, often conveying “you see” or giving background information. The place or organization comes before で.
JA: 姉は去年、東京の病院で働いてたんだ。
EN: My older sister was working at a hospital in Tokyo last year.

トムボストンで働いてたんだ

Tom worked in Boston.

信じられないどころか私はホーム・デポ店長だがあのサイコウチで働いてたんだ

You’ll never believe this—I’m the manager at Home Depot, and that psycho used to work for us.

— 人生スイッチ (2014)

僕はそこで働いてたんだ

I used to work there.

徹夜で働いてたんだ

I worked all night.