processing flow in batches