We consider a single-server, two-phase queueing system with N-policy. Customers arrive at the system according to a Poisson process and receive batch service in the first phase followed by individual services in the second phase. If the system becomes empty at the moment of the completion of the second-phase services, it is turned off. After an idle period, when the queue length reaches N (threshold), the server is turned on and begins to serve customers. We obtain the system size distribution and show that the system size decomposes into three random variables. The system sojourn time is provided. Analysis for the gated batch service model is also provided. Finally we derive a condition under which the optimal operating policy is achieved.