Hello, I'm trying to use the "transformBatch" tran...
# support
a
Hello, I'm trying to use the "transformBatch" transformation but am having trouble figuring out under what conditions/for what events it gets called. Do my events need to have any specific properties/use a specific API?
m
Hey There! 👋 Your message has been received by the RudderStack team. We will forward this request to your Technical Account Manager, and they will get back to you shortly. Please use the thread for any additional comments.
q
You should use the
transformBatch
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