Flows
Node Types
Transform

Transform Nodes

Nodes for modifying, processing, and transforming data.

Available Nodes

Code
Run custom JavaScript
Generate UUID
Create unique IDs
Get Timestamp
Get current date/time
AI Agent
AI-powered analysis

Code

Code

Execute custom JavaScript code for complex transformations.

Configuration:

FieldTypeDescription
codestringJavaScript code to execute
outputNamestringName 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

Generate UUID

Creates a unique UUID v4 identifier.

Configuration:

FieldTypeDefaultDescription
variableNamestringidName for the output variable
prefixstring(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

Get Timestamp

Gets current date/time in various formats.

Configuration:

FieldTypeDescription
outputsarrayArray of timestamp outputs to generate

Output Format:

{
  "outputs": [
    { "variableName": "created_at", "format": "iso" },
    { "variableName": "unix_ts", "format": "unix_ms" }
  ]
}

Available Formats:

FormatOutput TypeExample
isostring2024-12-12T15:30:00.000Z
unix_msnumber1702394200000
unix_snumber1702394200
datestring2024-12-12
timestring15:30:00
datetimestring2024-12-12 15:30:00
yearstring2024
monthstring12
daystring12
weekdaystringThursday
weekday_shortstringThu
month_namestringDecember
week_numberstring50

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

AI Agent

Use AI to analyze, extract, or transform data. Can also call tools like sending emails or SMS.

Configuration:

FieldTypeDescription
promptstringInstructions for the AI
outputFieldsarrayExpected output fields
modelstringClaude model to use
temperaturenumberResponse creativity (0-1)
toolIdsarrayTools 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) → Respond

See Also: