
Data Instance node
Data Instance Node
Overview
The Data Instance Node reshapes incoming payloads into a governed, model-shaped object by evaluating direct JavaScript expressions for each field.
It is ideal when you want a strongly-typed, well-documented data structure (often aligned with a Compose data model) but you still need full flexibility to calculate each field from raw inputs, combined sources, or other computed fields.
Unlike template-style nodes that use {{ }} expressions, Data Instance works with plain JavaScript code and an execution engine that:
- Resolves field dependencies (via
$fields) automatically. - Supports single objects, arrays, or merged inputs from multiple upstream nodes.
- Performs type conversion into common scalar types (String, Boolean, Int/UInt, Float, DateTime).
Configuration Reference
Parameters
| Parameter | Type | Default | Required | Description |
|---|---|---|---|---|
| Model ID | string | "" | No | Data model ID. When selected, auto-populates fields from model schema. |
| Fields | array | [] | Yes | Field definitions for data transformation. |
| Error Mode | select | "continueAll" | Yes | stopOnError / continueAll |
Field Definition (fields[])
| Property | Type | Description |
|---|---|---|
| Name | string | Target field name (e.g., firstName, order.total). |
| Type | select | Output type (String, Boolean, Int8/16/32/64, UInt8/16/32/64, Float32/Float64, DateTime). |
| Expression | string (JS) | JavaScript code that returns the field value. Has access to $input, $node, $trigger, and $fields. |
| Required | boolean | Marks the field as required in the configuration UI. |
| Sensitivity | number (1--5) | Sensitivity level for data governance and UX. |
Settings
| Setting | Options | Default | Description |
|---|---|---|---|
| Timeout (seconds) | number | Pipeline default | Maximum execution time for this node (1--600). |
| Retry on Timeout | Pipeline Default / Enabled / Disabled | Pipeline Default | Whether to retry on timeout. |
| Retry on Fail | Pipeline Default / Enabled / Disabled | Pipeline Default | Whether to retry on failure. When Enabled, shows Advanced Retry Configuration. |
| On Error | Pipeline Default / Stop Pipeline / Continue Execution | Pipeline Default | Behavior when node fails after all retries. |
Advanced Retry Configuration
Only visible when Retry on Fail is set to Enabled.
| Field | Type | Default | Range | Description |
|---|---|---|---|---|
| Max Attempts | number | 3 | 1--10 | Maximum retry attempts. |
| Initial Delay (ms) | number | 1000 | 100--30,000 | Wait before first retry. |
| Max Delay (ms) | number | 120000 | 1,000--300,000 | Upper bound for backoff delay. |
| Multiplier | number | 2.0 | 1.0--5.0 | Exponential backoff multiplier. |
| Jitter Factor | number | 0.1 | 0--0.5 | Random jitter. |
Expression Examples
Simple Field Calculations
// Capitalize a name
$input.firstName.toUpperCase()
// Calculate year
new Date().getFullYear()
// Mark adults vs minors
$input.age >= 18
Using $node for Cross-Node Data
// Read a field from a named upstream node
$node['Read Sensor'].temperature
// Combine data from multiple upstream nodes
$node['Fetch User'].name + ' (' + $node['Fetch Roles'].role + ')'
// Access nested data from a connector node
$node['REST Request'].body.items[0].id
Using $fields for Dependencies
// fullName field
$input.firstName + ' ' + $input.lastName
// greeting field that reuses fullName
'Hello, ' + $fields.fullName
// totalPrice based on other calculated fields
$fields.unitPrice * $fields.quantity
Usage Examples
Example 1: Normalize User Profile Payload
| Field | Value |
|---|---|
| Model ID | (optional) userProfileModel |
| Error Mode | continueAll |
Fields:
| Name | Type | Expression |
|---|---|---|
firstName | String | $input.first_name |
lastName | String | $input.last_name |
age | Int32 | $input.age |
fullName | String | $fields.firstName + ' ' + $fields.lastName |
The node converts an arbitrary incoming object into a clean, typed user profile while gracefully handling missing values.
Example 2: Transform Arrays of Items
Upstream node sends an array of orders:
[
{ id: 'ORD-1', amount: 42.5, currency: 'USD' },
{ id: 'ORD-2', amount: 103.0, currency: 'USD' }
]
Fields:
| Name | Type | Expression |
|---|---|---|
orderId | String | $input.id |
amount | Float64 | $input.amount |
displayLabel | String | 'Order ' + $input.id + ' (' + $input.currency + ')' |
The output is an array of normalized order objects with consistent types and labels.
Example 3: Merge Data from Multiple Upstream Nodes
| Field | Value |
|---|---|
| Model ID | (none) |
| Error Mode | stopOnError |
Fields:
| Name | Type | Expression |
|---|---|---|
sensorId | String | $node['Read Sensor'].id |
temperature | Float64 | $node['Read Sensor'].temperature |
operatorName | String | $node['Fetch Operator'].name |
lineName | String | $node['Fetch Operator'].assignedLine |
label | String | $fields.operatorName + ' — ' + $fields.lineName |
The node pulls data from two upstream nodes and combines them into a single, flat object. The label field uses $fields to reference previously computed fields.
When to Use Data Instance
Use the Data Instance node when you need:
- A strongly-typed, governed data model in the middle of a pipeline.
- Complex field calculations using full JavaScript rather than inline
{{ }}expressions. - To merge data from multiple upstream nodes into a single, well-structured object.