Transformations

Is there a limit on the number of transformations I can create and use?

The RudderStack Cloud Free and Starter plans let you create 5 JavaScript transformations. However, you can create unlimited transformations in the Growth and Enterprise plans. Refer to the Pricing page for more information.

RudderStack supports Python transformations only in the Growth and Enterprise plans.

Are there any sample user transformations I can refer to?

Refer to the Sample RudderStack Transformations GitHub repository.

Is the transformation connected to a source or destination?

A transformation is always connected to a destination. RudderStack gives you the option to add a transformation while setting up a destination, as shown:

Connecting a transformation

Can I connect multiple transformations to a destination?

No, it is not possible to connect multiple transformations to a destination. Instead, you can implement multiple use-cases in the same transformation, for example, event filtering followed by cleaning.

Can I write a transformation that can be applied to a small batch of events?

Yes, you can use the transformBatch function to apply a transformation to a batch of events.

For more information, refer to the Applying transformation on a batch of events section.

What is a referenced transformation?

If a library L is imported by the transformations T1, T2, and T3, then T1, T2, and T3are called the referenced transformations to L.

I used to write transformations like function transform(events) {}. Why am I not able to create new transformations this way?

By default, RudderStack supports writing functions that transform a single event instead of a batch of events. You can now define your transformation in the following manner:

export function transformEvent(event, metadata) {
return event;
}
def transformEvent(event, metadata):
return event

Can I update my existing version v0 transformation code to the the latest version?

You cannot update an existing Version: V0 transformation to the current version.

Instead, you can create a new transformation based on the transformEvent function, then reconnect your destinations with this transformation. Finally, delete the existing Version: V0 transformation.

What are transformation and library revisions?

Using the Transformations API, you can create and store a transformation or library as a draft without publishing them. These are called revisions.

Once the revisions meet the test criteria, you can restore and publish them for production use.

Libraries

How does RudderStack test any library updates?

If you update a library that is referenced in any transformation, RudderStack tests the new library code along with the transformation code against the default event payload. This ensures that the transformation does not break due to any changes in the library.

RudderStack currently does not support testing libraries with custom events.

Can I test my library with sample events?

RudderStack currently does not support testing libraries with custom events. It provides a default payload against which you can test the library code along with any referenced transformations.

For more information, refer to the How RudderStack tests updates to a library section.

Why am I not able to update my library?

If you update a library, RudderStack tests the new library code along with the referenced transformation code. This ensures that the transformation does not break due to any changes in the library.

If you're unable to update the library, it is likely that that the transformation is breaking because of the changes. Add the referenced transformation code and test the changes thoroughly.

What is a referenced library?

If a transformation T imports a library L in its code, then L is called as a referenced library to T.

I cannot import libraries into my existing transformations. What should I do?

If you cannot import libraries into your existing transformations, there is a strong likelihood that your existing transformations are based on the older version (Version: V0). To confirm if your transformation is based on an older version, check if your transformation has Version: V0, as shown:

v0 transformations

To import the libraries in a transformation, follow these steps:

  1. Create a new transformation by following the steps in the Adding a transformation section.
  2. Add the updated transformation code as specified in the transformEvent function section.
  3. Connect the transformation to your destination. For more information, refer to the Connecting a transformation to the destination section.
  4. You can then import libraries in the transformation. For more information, refer to the Using libraries in transformations section.

Contact us

For more information on the topics covered on this page, email us or start a conversation in our Slack community.

On this page