Skip to main content
Version: 3.0 (next)
Build Payload Node interface

Build Payload node

Build Payload Node

Overview​

The Build Payload Node assembles a structured, schema-aligned object from upstream data by evaluating direct JavaScript expressions for each field.
It is ideal when you want a strongly-typed, well-documented payload (often aligned with a UNS schema) but you still need full flexibility to compute each field from raw inputs, combined sources, or other computed fields.

Unlike template-style nodes that use {{ }} expressions, Build Payload works with plain JavaScript code and an execution engine that:

  • Resolves field dependencies (via $fields) automatically.
  • Reads the previous node's output as $input, and any upstream node by name with $node["Name"].
  • Performs type conversion into the field's type (string, bool, integers, floats, datetime and more).
  • Always produces one object, with one key per field.

Configuration Reference​

Parameters​

ParameterTypeDefaultRequiredDescription
Field sourceselectCustomNoUNS Schema fills the fields from a UNS data schema (needs the UNS licence); Custom lets you define the fields by hand.
Schema (Optional)select—NoShown when Field source is UNS Schema. Picking a schema fills the field list from its attributes.
Field Definitionsarray[]NoField definitions for the payload, evaluated top to bottom. With no fields, the input passes through unchanged.

Field Definition (fields[])​

PropertyTypeDescription
Field NamestringOutput key of the field (e.g., firstName). Names must be unique.
Field TypeselectType the value is converted to: string, bool, datetime, float32, float64, int8, int16, int32, int64, uint8, uint16, uint32, uint64, bytes, decimal, duration, uuid, timeseries_ref.
Expressionstring (JS)JavaScript code that returns the field value. Has access to $input, $node, $trigger, and $fields.
RequiredbooleanOn: the node fails when the field has no expression, the expression throws, returns nothing, or its value can't be converted. Off: the field is set to null, the problem is listed in _metadata.errors, and the node finishes as completed with errors.

Settings​

SettingOptionsDefaultDescription
Timeout (seconds)numberPipeline defaultMaximum execution time for this node (1--600).
Retry on TimeoutPipeline Default / Enabled / DisabledPipeline DefaultWhether to retry on timeout.
Retry on FailPipeline Default / Enabled / DisabledPipeline DefaultWhether to retry on failure. When Enabled, shows Advanced Retry Configuration.
On ErrorPipeline Default / Stop Pipeline / Continue ExecutionPipeline DefaultBehavior when node fails after all retries.

Advanced Retry Configuration​

Only visible when Retry on Fail is set to Enabled.

FieldTypeDefaultRangeDescription
Max Attemptsnumber31--10Maximum retry attempts.
Initial Delay (ms)number1000100--30,000Wait before first retry.
Max Delay (ms)number1200001,000--300,000Upper bound for backoff delay.
Multipliernumber2.01.0--5.0Exponential backoff multiplier.
Jitter Factornumber0.10--0.5Random jitter.

Expression Examples​

Simple Field Calculations​

// Capitalize a name
$input[0].result.firstName.toUpperCase()

// Calculate year
new Date().getFullYear()

// Mark adults vs minors
$input[0].result.age >= 18

Using $node for Cross-Node Data​

// Read a field from a named upstream node
$node['Read Sensor'].result.temperature

// Combine data from multiple upstream nodes
$node['Fetch User'].result.name + ' (' + $node['Fetch Roles'].result.role + ')'

// Access nested data from a connector node
$node['REST Request'].result.body.items[0].id

Using $fields for Dependencies​

// fullName field
$input[0].result.firstName + ' ' + $input[0].result.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​

FieldValue
Field sourceCustom (define fields manually)

Fields:

NameTypeExpression
firstNamestring$input[0].result.first_name
lastNamestring$input[0].result.last_name
ageint32$input[0].result.age
fullNamestring$fields.firstName + ' ' + $fields.lastName

The node converts an arbitrary incoming object into a clean, typed user profile. None of the fields is Required, so a missing value becomes null and is listed in _metadata.errors instead of failing the node.

Example 2: Summarize a List of Orders​

The previous node returns a list of orders as its result:

[
{ id: 'ORD-1', amount: 42.5, currency: 'USD' },
{ id: 'ORD-2', amount: 103.0, currency: 'USD' }
]

Fields:

NameTypeExpression
orderCountint32$input[0].result.length
totalAmountfloat64$input[0].result.reduce((sum, o) => sum + o.amount, 0)
firstOrderIdstring$input[0].result[0].id

The output is one object, { orderCount: 2, totalAmount: 145.5, firstOrderId: 'ORD-1' }. Build Payload doesn't run once per list item; to build one payload per order, place it inside a For-Each Loop and read the order with $item.

Example 3: Merge Data from Multiple Upstream Nodes​

FieldValue
Field sourceCustom (define fields manually)

Fields (all marked Required):

NameTypeExpression
sensorIdstring$node['Read Sensor'].result.id
temperaturefloat64$node['Read Sensor'].result.temperature
operatorNamestring$node['Fetch Operator'].result.name
lineNamestring$node['Fetch Operator'].result.assignedLine
labelstring$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. Because every field is Required, the node fails if either upstream value is missing.

When to Use Build Payload

Use the Build Payload node when you need:

  • A strongly-typed, schema-aligned payload 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.

Configuration reference​

The fields below are generated from the node's config contract, so they match what the pipeline validator enforces and what the designer's form offers.

functions.instance.data​

FieldTypeRequiredDefaultValuesDescription
fieldsobject[]no——Fields of the payload, evaluated top to bottom; a later field may read an earlier one as $fields.<name>. Names must be unique — the output has one slot per name. With no entries the input passes through unchanged