When can depositions be availed of?

When can depositions be availed of?
  1. During a pending action (Rule 23 of the Rules of Court), also known as "deposition de benne esse"; and
  2. Before action or Pending appeal  (Rule 24 of the Rules of Court), also known as "deposition in perpetuam rei memoriam."