Defined random event cloud function