Loading learning content…
Loading learning content…
Map, filter, aggregate, and reshape data as it flows through your automation pipeline.
Read through the lesson, mark it complete when the concept is clear, then move to the next lesson in the sequence or jump back to the module map.
Most real-world automation workflows spend more time transforming data than executing business logic. Understanding transformation patterns prevents brittle workflows that break on minor format changes.
Set node — add, modify, or remove fields from each item.
Function node (Code) — write JavaScript to transform data arbitrarily.
Merge node — combine data from multiple branches.
Split In Batches — process large arrays in chunks.
Filter node — remove items that don't match criteria.
Field mapping (renaming and restructuring):
// Transform CRM format to email format
return items.map(item => ({
json: {
to: item.json.email_address,
name: `${item.json.first_name} ${item.json.last_name}`,
company: item.json.organization_name
}
}));
Aggregation (combining many items into one):
const summary = items.reduce((acc, item) => ({
total: acc.total + item.json.amount,
count: acc.count + 1
}), { total: 0, count: 0 });
return [{ json: summary }];
Validate data shape between workflow stages. A malformed item that passes through 5 nodes before failing is much harder to debug than one that fails immediately.
Add validation nodes at entry points and after external API calls.
Transformations fail on edge cases: null values, empty arrays, unexpected types. Write transformation logic defensively — assume any field can be missing or malformed. Test with representative samples including edge cases before deploying.