Neo Transformation is a powerful service that transforms event data (like customer and transaction events) according to your specific requirements. Unlike the standard JOLT transformation system, Neo Transformation provides greater flexibility by allowing you to define custom transformation endpoints for different types of events in your organization.
Default Event Transformation Behaviour
If no custom logic is configured, the Cortex Search framework applies Global dataflows created on Neo for events related to Customer and Transaction entities. This default transformation extracts relevant fields, restructures custom and extended attributes into searchable formats, and standardises identifiers and other commonly used attributes. This ensures that incoming events are consistently formatted and optimised for indexing in Cortex Search. These are applied automatically unless you override them.
Customising Event Transformation
You can configure a custom event transformation if the default transformation doesn’t meet your organisation’s requirements. This allows you to define how event data should be modified before being indexed in Cortex Search.
To implement a custom transformation, you can create a new event transformation dataflow in Neo for your organisation. The global dataflows available for both Customer and Transaction events can be used as a starting point. Copy the Event Router script from the relevant global dataflow, modify it to suit your needs, and publish your new dataflow.
Once published and enabled for your organisation, this custom logic will override the global transformation for that entity type and will be applied to new search criteria that you create. You can disable the custom config using the API and can also apply other custom logic as per your requirement. Only one active custom configuration can exist for a given entity type within an organisation at any time.
Benefits
- Organization-Specific Transformations: Configure transformations tailored to your organization's needs
- Per-Entity Type Configuration: Set different transformation endpoints for customers, transactions, and other entity types
- Flexible Deployment: Use either organization-specific or global default transformations
- Easy Management: Simple API for creating, updating, and managing transformation configurations
- Enhanced Transformation Capabilities: Support for complex business logic that goes beyond simple mapping
Note
Ensure your custom transformation endpoint includes proper error handling and returns descriptive error messages when transformations fail.
Examples
Transaction Events Example
Configuration
{
"orgId": 15511,
"entityType": "TRANSACTION",
"transformEndpoint": "/transform/transaction/custom",
"active": true
}
Input Event
{
"eventId": "756748cd-54a5-41ab-ac7e-ecc47b34e1df",
"eventType": "15511_transactionAdded",
"consumerGroupId": "",
"actionType": "START",
"timeStamp": 1683543603022,
"attributes": {
"eventName": "transactionAdded",
"data": {
"amount": 200,
"billNumber": "2023-05-12_44",
"enteredAt": 1684836269988,
"billDate": 1684836269988,
"transactionId": 2149289332,
"deliveryStatus": "SHIPPED",
"billType": "REGULAR",
"lineItemCount": 2,
"discount": 10,
"grossAmount": 110,
"enteredBy": {
"id": 15071481,
"till": {
"code": "cm.1",
"name": "cm.1"
},
"store": {
"code": "mergestore1",
"name": "MERGE FRONT ONE",
"externalId": "aS123",
"externalId1": "Q123",
"externalId2": "ASDA123"
}
},
"customerIdentifiers": {
"customerId": 424872520,
"loyaltyType": "loyalty",
"instore": {
"mobile": "919755252060",
"email": "[email protected]"
}
},
"customFields": [
{
"key": "field2",
"value": "10"
}
],
"extendedFields": [
{
"key": "field4",
"value": "25.24"
}
]
},
"orgId": 15511,
"refId": "15511_2149289332",
"apiRequestId": "7d408f9c7531f28ef7298a5668eacdd6",
"createdAt": 1684836270214
}
}
Transformed Output
{
"eventName": "transactionAdded",
"amount": 200,
"billnumber": "2023-05-12_44",
"enteredAt": 1684836269988,
"billdate": 1684836269988,
"entityId": 2149289332,
"deliveryStatus": "SHIPPED",
"entityReference": "REGULAR",
"entityreference": "REGULAR",
"lineItemCount": 2,
"discount": 10,
"grossAmount": 110,
"additionalfields": {
"storecode": "mergestore1",
"storename": "MERGE FRONT ONE"
},
"customerIdentifiers": {
"customerId": 424872520,
"loyaltyType": "loyalty",
"instore": {
"mobile": "919755252060",
"email": "[email protected]"
}
},
"customfields": {
"field2": "10"
},
"extendedfields": {
"field4": "25.24"
},
"orgId": 15511,
"refId": "15511_2149289332",
"apiRequestId": "7d408f9c7531f28ef7298a5668eacdd6",
"createdOn": 1684836270214
}
Customer Events Example
Configuration
{
"orgId": 15511,
"entityType": "CUSTOMER",
"transformEndpoint": "/transform/customer/custom",
"active": true
}