We study the problem of batching and scheduling n jobs in a flow shop comprising m, m ≥ 2, machines. Each job has to be processed on machines 1, …, m in this order. Batches are formed on each machine. A machine dependent setup time precedes the processing of each batch. Jobs of the same batch are processed on each machine sequentially so that the processing time of a batch is equal to the sum of the processing times of the jobs contained in it. Jobs of the same batch formed on machine 1 become available for a downstream operation on machine 1+1 at the same time when the processing of the last job of the batch on machine 1 has been finished. The objective is to minimize maximum job completion time. We establish several properties of an optimal schedule and develop polynomial time algorithms for important special cases. They are improvements over the existing methods with regard to their generality and time efficiency.