Data
Uncontrolled node
Overview
The Data node creates structured JSON objects using templates with variable substitution. It uses Handlebars syntax ({{variableName}}) to dynamically insert values from workflow variables, parent workflow variables, or connected inputs.
When you type a JSON template into the node's code editor, it automatically detects any variables wrapped in double curly braces and creates corresponding input sockets for them. This allows you to construct complex data objects by combining static JSON structure with dynamic values from your workflow.
Variable Resolution
Variables in your JSON template are resolved in the following priority order:
- Connected inputs - Values passed through dynamically created input sockets
- Parent workflow variables - Variables set in the immediate parent workflow scope
- Root workflow variables - Global variables set at the top-level workflow
If a variable cannot be resolved, it will be replaced with undefined in the output.
Inputs
| Input | Type | Description | Default |
|---|---|---|---|
| value | Data | A JSON template string using Handlebars syntax ({{variable}}) for variable substitution. Can be provided via the code editor in the properties panel or connected as an input. | - |
| Dynamic inputs | Data | Additional inputs are automatically created based on Handlebars variables detected in the value template. For example, {{userId}} in your template creates a userId input socket. | - |
Outputs
| Output | Type | Description |
|---|---|---|
| output | Data | The parsed JSON object with all Handlebars variables substituted with their resolved values. If parsing fails, outputs an error message string. |
Runtime Behavior and Defaults
- Execution: This node runs automatically (uncontrolled) whenever any connected input changes or when the workflow variables referenced in the template are updated.
- Template Parsing: The node parses the JSON template at runtime, substituting Handlebars variables with values from the workflow context.
- Error Handling: If the JSON is malformed or variable substitution results in invalid JSON, the node outputs the error message instead of an object.
- Caching: As an uncontrolled node, the output is cached and only recomputed when inputs change.
Example
Creating a User Object
Scenario: Combine a user ID from a variable and a name from an input into a structured user object.
Configuration:
- value property:
{
"id": "{{userId}}",
"name": "{{userName}}",
"timestamp": "{{currentTime}}",
"metadata": {
"source": "web_form"
}
}
Inputs:
userId(connected to a Variable node containing"12345")userName(connected to a Text node containing"John Doe")currentTime(connected to a Datetime node)
Output:
{
"id": "12345",
"name": "John Doe",
"timestamp": "2024-01-15T10:30:00Z",
"metadata": {
"source": "web_form"
}
}
Transforming Data Structure
Scenario: Reformat data from one structure to another for compatibility with a database or API.
Configuration:
- value property:
{
"customer": {
"firstName": "{{first}}",
"lastName": "{{last}}",
"fullName": "{{first}} {{last}}"
},
"contact": {
"email": "{{email}}",
"phone": "{{phone}}"
}
}
Inputs:
first,last,email,phoneconnected to form data or previous node outputs
Output: A nested JSON object suitable for a CRM system or database insertion.