Jolt
1. Overview
The Jolt component (jolt-connector) transforms a JSON into another JSON shape, using a transformation specification written in the Jolt language (widely used to map data structures between different systems).
Use it when the flow needs to restructure a JSON — rename fields, change hierarchy, combine or split lists — without writing custom code. For simple transformations (a few fields), Add Variable may be easier to maintain.
2. Prerequisites
No external credentials — local processing.
3. Authentication and Connection
Not applicable.
4. Configuration / Supported Operations
The component has a single operation: transform a JSON using a Jolt spec.
| Field | Required | Type | Description | Example |
|---|---|---|---|---|
json | Yes | Text (JSON) | The input data to transform. | {"fullName": "Maria Silva"} |
joltExpression | Yes | Text (JSON, Jolt spec) | The Jolt specification that defines how to transform the input json. | A Jolt spec (shift, default format, etc.) |
5. Practical Examples
Simple example: rename a field of a received JSON.
Input (not used directly — the data comes from the json configuration field):
{
"rawCustomer": { "fullName": "Maria Silva", "contactEmail": "maria@example.com" }
}
Component configuration:
{
"componentName": "jolt-connector",
"configurations": {
"json": "{$.body.rawCustomer}",
"joltExpression": "[{\"operation\": \"shift\", \"spec\": {\"fullName\": \"name\", \"contactEmail\": \"email\"}}]"
}
}
Response:
{
"response": {
"name": "Maria Silva",
"email": "maria@example.com"
}
}
Advanced example: restructure a list of orders, extracting only the fields needed from each item.
Input:
{
"orders": [
{ "orderId": 981, "customer": { "name": "Maria Silva" }, "totalAmount": 150.00 },
{ "orderId": 982, "customer": { "name": "John Smith" }, "totalAmount": 89.90 }
]
}
Component configuration:
{
"componentName": "jolt-connector",
"configurations": {
"json": "{$.body.orders}",
"joltExpression": "[{\"operation\": \"shift\", \"spec\": {\"*\": {\"orderId\": \"[&1].id\", \"customer.name\": \"[&1].customerName\", \"totalAmount\": \"[&1].amount\"}}}]"
}
}
Response:
{
"response": [
{ "id": 981, "customerName": "Maria Silva", "amount": 150.00 },
{ "id": 982, "customerName": "John Smith", "amount": 89.90 }
]
}
6. Common Errors and Troubleshooting
| Error / Symptom | Likely Cause | How to Fix |
|---|---|---|
| "Required field 'json' is missing or null." | The json field wasn't filled in. | Fill in json with the data to transform. |
| "Required field 'joltExpression' is missing or null." | The joltExpression field wasn't filled in. | Fill in joltExpression with the transformation spec. |
| "Error during JOLT transformation: ..." | The Jolt spec is malformed, or isn't compatible with the input JSON's structure. | Review the Jolt spec's syntax and test it with the actual input data. |
| Result doesn't have the expected format | The Jolt spec doesn't cover all cases of the input JSON (e.g., missing fields in some items). | Adjust the Jolt spec to handle variations in the input data. |