Transform Nodes
Nodes for modifying, processing, and transforming data.
Available Nodes
Code
Execute custom JavaScript code for complex transformations.
Configuration:
| Field | Type | Description |
|---|---|---|
code | string | JavaScript code to execute |
outputName | string | Name for the returned value |
Writing Code:
Use {{ }} expressions to inject data from previous nodes:
// Access input data
const name = {{ $input.firstName }};
const data = {{ $node.fetch_data-1.data }};
// Process and return
return name + " - processed";Example - Calculate Order Total:
{
"id": "code-1",
"type": "code",
"label": "Calculate Total",
"config": {
"code": "const items = {{ $node.fetch_data-1.data }};\nconst subtotal = items.reduce((sum, item) => sum + item.price, 0);\nconst tax = subtotal * 0.08;\nreturn { subtotal, tax, total: subtotal + tax };",
"outputName": "orderCalc"
}
}Accessing Output: {{ $node.code-1.orderCalc }}
Generate UUID
Creates a unique UUID v4 identifier.
Configuration:
| Field | Type | Default | Description |
|---|---|---|---|
variableName | string | id | Name for the output variable |
prefix | string | (none) | Optional prefix (e.g., usr_, ord_) |
Example - Simple UUID:
{
"id": "generate_uuid-1",
"type": "generate_uuid",
"label": "Generate ID",
"config": {
"variableName": "id"
}
}Output: { "id": "550e8400-e29b-41d4-a716-446655440000" }
Accessing: {{ $node.generate_uuid-1.id }}
Example - Prefixed ID:
{
"config": {
"variableName": "orderId",
"prefix": "ord_"
}
}Output: { "orderId": "ord_550e8400-e29b-41d4-a716-446655440000" }
Get Timestamp
Gets current date/time in various formats.
Configuration:
| Field | Type | Description |
|---|---|---|
outputs | array | Array of timestamp outputs to generate |
Output Format:
{
"outputs": [
{ "variableName": "created_at", "format": "iso" },
{ "variableName": "unix_ts", "format": "unix_ms" }
]
}Available Formats:
| Format | Output Type | Example |
|---|---|---|
iso | string | 2024-12-12T15:30:00.000Z |
unix_ms | number | 1702394200000 |
unix_s | number | 1702394200 |
date | string | 2024-12-12 |
time | string | 15:30:00 |
datetime | string | 2024-12-12 15:30:00 |
year | string | 2024 |
month | string | 12 |
day | string | 12 |
weekday | string | Thursday |
weekday_short | string | Thu |
month_name | string | December |
week_number | string | 50 |
Example:
{
"id": "get_timestamp-1",
"type": "get_timestamp",
"label": "Get Timestamp",
"config": {
"outputs": [
{ "variableName": "timestamp", "format": "iso" },
{ "variableName": "date", "format": "date" }
]
}
}Accessing: {{ $node.get_timestamp-1.timestamp }}
Note: Use unix_ms or unix_s for INTEGER database columns.
AI Agent
Use AI to analyze, extract, or transform data. Can also call tools like sending emails or SMS.
Configuration:
| Field | Type | Description |
|---|---|---|
prompt | string | Instructions for the AI |
outputFields | array | Expected output fields |
model | string | Claude model to use |
temperature | number | Response creativity (0-1) |
toolIds | array | Tools the AI can use |
Example - Sentiment Analysis:
{
"id": "ai_transform-1",
"type": "ai_transform",
"label": "Analyze Feedback",
"config": {
"aiTransformConfig": {
"prompt": "Analyze the sentiment of this feedback: {{ $input.feedback }}",
"outputFields": [
{ "name": "sentiment", "description": "positive, negative, or neutral" },
{ "name": "confidence", "description": "Confidence score from 0 to 100" },
{ "name": "summary", "description": "Brief summary of the feedback" }
],
"model": "claude-sonnet-4-20250514",
"temperature": 0.3,
"toolIds": []
}
}
}Example - Data Extraction:
{
"config": {
"aiTransformConfig": {
"prompt": "Extract contact information from: {{ $input.text }}",
"outputFields": [
{ "name": "name", "description": "Full name of the person" },
{ "name": "email", "description": "Email address" },
{ "name": "phone", "description": "Phone number" }
],
"model": "claude-sonnet-4-20250514"
}
}
}Example - AI with Tools:
{
"config": {
"aiTransformConfig": {
"prompt": "Analyze this complaint. If urgent, send an email to support@company.com.",
"outputFields": [
{ "name": "urgency", "description": "high, medium, or low" },
{ "name": "action_taken", "description": "What action was taken" }
],
"model": "claude-sonnet-4-20250514",
"toolIds": ["send_email"]
}
}
}Use Cases:
- Sentiment analysis
- Text summarization
- Data extraction from unstructured text
- Content classification
- Automated responses
Common Transform Patterns
Prepare Data for Insert
Generate UUID → Get Timestamp → Table Insert// In Table Insert, reference both:
{
"fields": [
{ "column": "id", "value": "{{ $node.generate_uuid-1.id }}" },
{ "column": "created_at", "value": "{{ $node.get_timestamp-1.timestamp }}" },
{ "column": "name", "value": "{{ $input.name }}" }
]
}Process and Transform
Fetch Data → Code (process) → AI Agent (analyze) → RespondSee Also: