Files
n8n-docs/docs/data/transforming-data.md
Kartik Balasubramanian 96e6ba167d Revamp the data section of n8n docs (#4077)
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
2026-02-25 14:30:33 +00:00

2.2 KiB

contentType
contentType
explanation

Approaches for transforming data

Data transformation in n8n involves modifying, restructuring, or enriching data as it moves through your workflow. This includes changing data formats, filtering or aggregating values, adding computed fields, and converting data structures to work with different nodes.

n8n uses a predefined data structure that allows all nodes to process incoming data correctly. When your data doesn't match this structure, or when you need to modify it for your use case, you'll need to transform it.

n8n provides several approaches for data transformation:

  • Expressions allow you to transform data directly in node parameters using n8n's expression syntax ({{ }})
  • The Code node lets you write custom JavaScript or Python for complex transformations.
  • The AI Transform node generates transformation code from natural language prompts.
  • Advanced transformation techniques: For sophisticated data manipulation, n8n supports:
    • Ternary operators: Conditional logic directly in expressions (condition ? valueIfTrue : valueIfFalse)
    • Chained functions: Combine multiple transformation functions
    • Complex expressions: Use JavaScript methods and operators within expression syntax
  • Specialized transformation nodes for common structural transformations:

For a comparison of these approaches, see Expressions versus data nodes.