Skip to main content
Version: 3.0
Build Payload Node interfaceBuild Payload Node interface

Build Payload node

Build Payload Node

Build one typed object from upstream data, computing each field with a JavaScript expression that can reuse earlier fields.

Expressions
JavaScript with $input · $node · $trigger · $fields
Output
One object, one key per field

Overview​

The Build Payload Node assembles a structured, typed object from upstream data by evaluating direct JavaScript expressions for each field.
It is ideal when you want a strongly-typed, well-documented payload 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 Definitionsarray[]YesField definitions for the payload, evaluated top to bottom. At least one field is required.

Before 3.0 a node could fill its fields from a UNS data schema. Data schemas became libraries and properties in 3.0, so the node no longer offers that source. A node saved with it keeps its fields, which run as before, and says which schema they were copied from until you edit the list; its source, schemaRef and schemaMinor are ignored.

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--3600).
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 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. At least one field is required
sourcestringno-schema, customKept for saved pipelines; no longer used. Where the fields came from, for the designer: schema when they were populated from a UNS data schema (schemaRef), custom when they were written by hand. Not read at run time; the node runs fields as saved. Leave it out of a new pipeline
schemaRefstringno--Kept for saved pipelines; no longer used. The UNS data schema the fields were populated from, as name@major (for example Pump@1); data schemas were replaced by the semantic layer in 3.0. Leave it out of a new pipeline
schemaMinorintegerno-at least 0Kept for saved pipelines; no longer used. The minor of schemaRef that was latest when the fields were populated. Only valid together with schemaRef