Portal Community

Properties

PropertyTypeRequiredDefaultDescription
operationstring enumYesThe operation to perform. One of: filter, map, reduce, sort, distinct, count, first, last, reverse.
inlineDataSourcestring (JSON array)No*""Inline JSON array literal. Shared base-class setting (InlineDataSource on BaseNodeExecutorSettings, config key inlineDataSource) — the same setting DataMapping uses. If non-empty, it wins outright over reading InputData["items"]. *Either this or a resolvable upstream items input must be present.
expressionstring (JS expression)DependsA JavaScript expression evaluated per element. The current element is available as item. Required for filter, map, reduce — the node throws "collectionExpression is required for {operation}" if missing.
fieldstringDependsField name used by sort and distinct operations to specify which property to sort or deduplicate on. Omit for arrays of primitive values.
directionstring enumNoascSort direction for the sort operation. One of: asc (ascending) or desc (descending).
initialValuestringNoThe starting accumulator value for reduce, given as a plain string. Parsed as long, then double, then bool, falling back to the raw string if none match — so "0" becomes the number 0, and "" stays an empty string for concatenation. Left as null if omitted.
onErrorstring enumNocontinueShared base-class setting. "continue": skip failing items, keep processing, never fail the node on error count alone. "error": fail the node once errorCount exceeds maxErrorCount.
maxErrorCountintegerNo0Used only when onError is "error". The node fails once item errors exceed this count. 0 = fail on any error.
maxErrorsToCollectintegerNo0Safety cap, independent of onError: stop processing and fail once this many item errors are seen. 0 = unlimited (no circuit-breaker).

Expression Context

The item and acc Variables

In filter and map, the expression is evaluated once per element with the current element bound to item. For reduce, the expression receives both item (current element) and acc (current accumulator) — each evaluation's result becomes the next step's acc.

Per-Operation Parameter Requirements

OperationexpressionfielddirectioninitialValue
filterRequired (boolean expression)
mapRequired (transform expression)
reduceRequired (acc + item expr)Recommended (defaults to null)
sortOptional (omit for primitive arrays)Optional
distinctOptional (for objects)
count
first
last
reverse

Note: unlike filter/map/reduce, count/first/last do not take a filter expression — they operate on the whole resolved collection as-is. Filter first with a separate filter operation if you need a conditional count/first/last.

Example Configurations

// Filter: keep only active orders
{
  "operation": "filter",
  "expression": "item.status === 'active'"
}

// Map: extract just the IDs
{
  "operation": "map",
  "expression": "item.orderId"
}

// Reduce: sum all totals
{
  "operation": "reduce",
  "expression": "acc + item.total",
  "initialValue": "0"
}

// Sort: by price descending
{
  "operation": "sort",
  "field": "price",
  "direction": "desc"
}

// Distinct: unique by email field
{
  "operation": "distinct",
  "field": "email"
}

// Filter with strict error handling: fail if more than 5 items error out
{
  "operation": "filter",
  "expression": "item.status === 'active'",
  "onError": "error",
  "maxErrorCount": 5
}
NaN results count as item errors, not silent output

For map and reduce, if the expression evaluates to NaN (e.g. arithmetic on a missing or non-numeric field), that item is recorded as a failure in errorRecords/errorCount rather than writing NaN into the result. This is different from a resolved-but-empty collection: an empty or null source (see below) is not an error at all.

Empty Collection Behaviour

If the resolved collection is an empty array, the node still succeeds: an empty items array for list operations, null for first/last, 0 for count, or the untouched initialValue for reduce. The error port fires only when the collection cannot be resolved at all (no inlineDataSource and no upstream items), not when it resolves to a valid empty array.