你来的时候我刚好要走。

I was about to leave when you came in.

Source: Tatoeba

Sentence Composition