Duration Before a Past Event
Use Past Perfect Continuous (had been + verb-ing) to show that an action had been happening for a period of time before something else happened in the past.
Structure:
had been + -ing
Example: She was tired because she had been running.