average-optician-13120
06/15/2023, 6:03 PMmillions-activity-52391
06/15/2023, 6:03 PMquiet-wolf-72320
06/16/2023, 5:49 AMtransformBatch function when you want to apply a transformation to a batch of events, especially when performing aggregation or roll-up operations on the batch. However, it is highly recommended to use transformEvent as much as possible, as it ensures event ordering. When using transformBatch, make sure you pass the messageId from the input event to the output event to ensure event ordering, as RudderStack does not guarantee event ordering without the messageId.
https://www.rudderstack.com/docs/features/transformations/cloud-mode-transformations/#applying-transformation-on-a-batch-of-events