être en train de (+ inf.) to be in the process (of doing something)
Note de grammaire (p. 269) Sometimes you have to use both the imparfait and the PC in the same sentence. For example, you might want to say that one action was going on (imparfait) when another action happened (PC).
Note de grammaire (p. 269) To emphasize that you were in the middle of or busy doing something, you can use the imperfect of the expression être en train de with an infinitive.
Note de grammaire (p. 269) J’étais en train de faire mes devoirs quand le téléphone a sonné.