Skip to main content

Node Inputs

Required Fields

Template:
The template text with placeholders.
Example: "Hello {{name}}, your order #{{order_id}} totaling {{amount}} has been confirmed."
Data:
A JSON object containing values for the placeholders.
Example:
{
  "name": "John Doe",
  "order_id": "12345",
  "amount": "$99.99"
}

Optional Fields

Placeholder Format:
The format for placeholders in the template.
Available options:
  • {{placeholder}}: Double curly braces (Mustache style)
  • {placeholder}: Single curly braces
  • $placeholder: Dollar sign prefix
    Default: {{placeholder}}
Missing Value Handling:
How to handle missing placeholder values.
Available options:
  • keep: Keep the placeholder as-is
  • empty: Replace with empty string
  • error: Raise an error
    Default: empty
Escape HTML:
Escape HTML characters in replacement values.
Example: false
Default: false

Node Output

Merged Text:
The template with all placeholders replaced with actual values.
Example Output:
{
  "template": "Hello {{name}}, your order #{{order_id}} totaling {{amount}} has been confirmed.",
  "merged_text": "Hello John Doe, your order #12345 totaling $99.99 has been confirmed.",
  "placeholders_found": 3,
  "placeholders_replaced": 3,
  "placeholders": ["name", "order_id", "amount"]
}
Advanced Template Example:
{
  "template": "Subject: {{subject}}\n\nDear {{customer.name}},\n\nYour {{product.name}} will be delivered on {{delivery.date}}.",
  "data": {
    "subject": "Delivery Confirmation",
    "customer": {"name": "Jane Smith"},
    "product": {"name": "Coffee Maker"},
    "delivery": {"date": "October 25, 2024"}
  },
  "merged_text": "Subject: Delivery Confirmation\n\nDear Jane Smith,\n\nYour Coffee Maker will be delivered on October 25, 2024."
}

Node Functionality

The Merge with Template node:
  • Merges data into text templates using placeholders.
  • Supports multiple placeholder formats (Mustache, curly braces, dollar sign).
  • Handles nested data structures with dot notation.
  • Configurable handling of missing values.
  • Useful for email generation, report creation, and dynamic content.
  • Supports HTML escaping for safe HTML output.
I