John slipped in front of the bank, [which was embarrassing].
 You have to write a thesis in the end, [which is a cumbersome and lengthy process].
It's not "which" that is the relative clause, but the whole bracketed elements.
The relatives here are clearly non-restrictive; they simply provided non-integrated content that is not required to identify something in the head clause. It is normal to mark off non-restrictive relative clauses with commas, dashes or parentheses.
Non-restrictive relatives are also spoken as a separate intonation unit, which is a more reliable guide to non-restrictiveness than punctuation.
Non-restrictive relatives often have antecedents consisting of verb phrases or even whole clauses. In  the antecedent is the whole head clause, where we understand that 'John's slipping in front of the bank was embarrassing'. In  the antecedent is the clause "to write a thesis": we understand that 'writing a thesis is a cumbersome and lengthy process'.