sequence flatten and processing data using pipeline