Residential buildings may use energy storage, flexible loads, and renewable energy sources to reduce energy consumption and increase demand side flexibility. The flexibility of a single building can be coordinated with other facilities in a transactive energy (TE) market to reduce energy costs. In addition, cloud energy storage (CES) has been proposed to provide storage services for residential buildings with more economic benefits than individual energy storage units in recent years. Although the TE market and CES implementation have received much attention in previous works, a suitable structure for CES participation in TE market has not been addressed. Furthermore, previous studies ignored all or some sources of uncertainties in the TE decision making process. This paper presents a stochastic optimization model in a transactive energy framework based on a distributed optimization algorithm for peer‐to‐peer energy trading using the alternating direction method of multipliers in the presence of CES. This paper considers the uncertainties of the inflexible load demand, renewable energy generations, and market prices using an artificial neural network‐based scenario generation and reduction methodology. Numerical results show improvements toward addressing the challenges of the uncertainties while maximizing the CES's owner revenue and minimizing the customers’ costs in the proposed model.